Skip to content
Commit 55669934 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller
Browse files

tg3: Fix soft lockup when tg3_reset_task() fails.



If tg3_reset_task() fails, the device state is left in an inconsistent
state with IFF_RUNNING still set but NAPI state not enabled.  A
subsequent operation, such as ifdown or AER error can cause it to
soft lock up when it tries to disable NAPI state.

Fix it by bringing down the device to !IFF_RUNNING state when
tg3_reset_task() fails.  tg3_reset_task() running from workqueue
will now call tg3_close() when the reset fails.  We need to
modify tg3_reset_task_cancel() slightly to avoid tg3_close()
calling cancel_work_sync() to cancel tg3_reset_task().  Otherwise
cancel_work_sync() will wait forever for tg3_reset_task() to
finish.

Reported-by: default avatarDavid Christensen <drc@linux.vnet.ibm.com>
Reported-by: default avatarBaptiste Covolato <baptiste@arista.com>
Fixes: db219973 ("tg3: Schedule at most one tg3_reset_task run")
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent af0ae997
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