Skip to contentSkip to conversation

can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue

PATCH In review Amitoj Kaur Chawla 2 participants 2 messages Mar 17, 2016 – Mar 24, 2016 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

WQ_MEM_RECLAIM flag has not been set here since this driver doesn't seem to sit in the memory reclaim path.

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

---
Changes in v2:
-Updated commit message

 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,

Quoted 10 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.

WQ_MEM_RECLAIM flag has not been set here since this driver doesn't seem to sit in the memory reclaim path.

Ditto with WQ_MEM_RECLAIM.

Thanks.

Signature · 1 line
tejun