Commit c80b0c28 authored by Divy Le Ray's avatar Divy Le Ray Committed by David S. Miller

cxgb3: fix workqueue flush issues

The fatal error task can be scheduled while processing an offload packet
in NAPI context when the connection handle is bogus. this can race
with the ports being brought down and the cxgb3 workqueue being flushed.
Stop napi processing before flushing the work queue.

The ULP drivers (iSCSI, iWARP) might also schedule a task on keventd_wk
while releasing a connection handle (cxgb3_offload.c::cxgb3_queue_tid_release()).
The driver however does not flush any work on keventd_wq while being unloaded.
This patch also fixes this.

Also call cancel_delayed_work_sync in place of the the deprecated
Signed-off-by: default avatarDivy Le Ray <>
Signed-off-by: default avatarDavid S. Miller <>
parent 3851c66c
......@@ -1117,8 +1117,8 @@ static void cxgb_down(struct adapter *adapter)
flush_workqueue(cxgb3_wq); /* wait for external IRQ handler */
flush_workqueue(cxgb3_wq); /* wait for external IRQ handler */
static void schedule_chk_task(struct adapter *adap)
......@@ -1187,6 +1187,9 @@ static int offload_close(struct t3cdev *tdev)
sysfs_remove_group(&tdev->lldev->dev.kobj, &offload_attr_group);
/* Flush work scheduled while releasing TIDs */
tdev->lldev = NULL;
t3_tp_set_offload_mode(adapter, 0);
......@@ -1247,8 +1250,7 @@ static int cxgb_close(struct net_device *dev)
if (!(adapter->open_device_map & PORT_MASK))
if (!adapter->open_device_map)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment