can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue
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
@@ -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
Hello, Amitoj.
Quoted 9 lines · Amitoj Kaur Chawla
Replace scheduled to be removed
create_freezable_workqueuewithalloc_workqueue.
priv->wqshould 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 ofWQ_FREEZABLEflag 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