Skip to content

Commit b6fd3ab

Browse files
musicakcmarckleinebudde
authored andcommitted
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 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> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 056a720 commit b6fd3ab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/net/can/spi/mcp251x.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,8 @@ static int mcp251x_open(struct net_device *net)
961961
goto open_unlock;
962962
}
963963

964-
priv->wq = create_freezable_workqueue("mcp251x_wq");
964+
priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
965+
0);
965966
INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler);
966967
INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler);
967968

0 commit comments

Comments
 (0)