All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue
@ 2016-03-15 15:08 Amitoj Kaur Chawla
  2016-03-16 14:50 ` [Outreachy kernel] " Tejun Heo
  0 siblings, 1 reply; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-15 15:08 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: tj

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.

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

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/net/can/spi/mcp251x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 575790e..58b6e41 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -961,7 +961,7 @@ 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, 0);
 	INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler);
 	INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler);
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue
  2016-03-15 15:08 [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue Amitoj Kaur Chawla
@ 2016-03-16 14:50 ` Tejun Heo
  0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2016-03-16 14:50 UTC (permalink / raw)
  To: Amitoj Kaur Chawla; +Cc: outreachy-kernel

Hello, Amitoj.

On Tue, Mar 15, 2016 at 08:38:24PM +0530, 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.
> 
> The order of execution is not important so set @max_active as 0.

Can you please mention why it's okay to drop the WQ_MEM_RECLAIM part?
Otherwise, it looks good to me.

Thanks!

-- 
tejun


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue
  2016-04-08 15:32 Amitoj Kaur Chawla
@ 2016-04-11  8:35 ` Marc Kleine-Budde
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2016-04-11  8:35 UTC (permalink / raw)
  To: Amitoj Kaur Chawla, wg, linux-can, netdev, linux-kernel; +Cc: tj


[-- Attachment #1.1: Type: text/plain, Size: 983 bytes --]

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   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue
@ 2016-04-08 15:32 Amitoj Kaur Chawla
  2016-04-11  8:35 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2016-04-08 15:32 UTC (permalink / raw)
  To: wg, mkl, linux-can, netdev, linux-kernel; +Cc: tj

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-11  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-15 15:08 [PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue Amitoj Kaur Chawla
2016-03-16 14:50 ` [Outreachy kernel] " Tejun Heo
2016-04-08 15:32 Amitoj Kaur Chawla
2016-04-11  8:35 ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.