Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1374317 > unrolled thread

[PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue

Started byAmitoj Kaur Chawla <amitoj1606@gmail.com>
First post2016-04-08 17:40 +0200
Last post2016-04-11 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] can: mcp251x: Replace create_freezable_workqueue with  alloc_workqueue Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-04-08 17:40 +0200
    Re: [PATCH] can: mcp251x: Replace create_freezable_workqueue with  alloc_workqueue Marc Kleine-Budde <mkl@pengutronix.de> - 2016-04-11 10:50 +0200

#1374317 — [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue

FromAmitoj Kaur Chawla <amitoj1606@gmail.com>
Date2016-04-08 17:40 +0200
Subject[PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue
Message-ID<rlGFR-60n-29@gated-at.bofh.it>
Replace scheduled to be removed create_freezable_workqueue with
alloc_workqueue.

priv->wq should be explicitly set as freezable to ensure it is frozen
in the suspend sequence and work items are drained so that no new work
item starts execution until thawed. Thus, use of WQ_FREEZABLE flag
here is required.

WQ_MEM_RECLAIM flag has been set here to ensure forward progress
regardless of memory pressure.

The order of execution is not important so set @max_active as 0.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
---
 drivers/net/can/spi/mcp251x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 74a7dfe..cf36d26 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -961,7 +961,8 @@ static int mcp251x_open(struct net_device *net)
 		goto open_unlock;
 	}
 
-	priv->wq = create_freezable_workqueue("mcp251x_wq");
+	priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
+				   0);
 	INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler);
 	INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler);
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1375622

FromMarc Kleine-Budde <mkl@pengutronix.de>
Date2016-04-11 10:50 +0200
Message-ID<rmFHI-2Ui-11@gated-at.bofh.it>
In reply to#1374317

[Multipart message — attachments visible in raw view] — view raw

On 04/08/2016 05:32 PM, Amitoj Kaur Chawla wrote:
> Replace scheduled to be removed create_freezable_workqueue with
> alloc_workqueue.
> 
> priv->wq should be explicitly set as freezable to ensure it is frozen
> in the suspend sequence and work items are drained so that no new work
> item starts execution until thawed. Thus, use of WQ_FREEZABLE flag
> here is required.
> 
> WQ_MEM_RECLAIM flag has been set here to ensure forward progress
> regardless of memory pressure.
> 
> The order of execution is not important so set @max_active as 0.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> Acked-by: Tejun Heo <tj@kernel.org>

Applied to can-next/master.

Tnx,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web