Skip to contentSkip to conversation

can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue

PATCH Superseded Amitoj Kaur Chawla 2 participants 2 messages Mar 15, 2016 – Mar 16, 2016 CAN network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue

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.

---
 drivers/net/can/spi/mcp251x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251x.c +1 -1
index 575790e..58b6e41 100644
@@ -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);
 
Signature · 1 line
1.9.1
#1 lore raw

Hello, Amitoj.

Quoted 9 lines · Amitoj Kaur Chawla

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!

Signature · 1 line
tejun