Skip to content
Commit 0486a063 authored by Ivan Vecera's avatar Ivan Vecera Committed by David S. Miller
Browse files

tg3: prevent ifup/ifdown during PCI error recovery



The patch fixes race conditions between PCI error recovery callbacks and
potential ifup/ifdown.

First, if ifup (tg3_open) is called between tg3_io_error_detected() and
tg3_io_resume() then tp->timer is armed twice before expiry. Once during
tg3_open() and again during tg3_io_resume(). This results in BUG
at kernel/time/timer.c:945.

Second, if ifdown (tg3_close) is called between tg3_io_error_detected()
and tg3_io_resume() then tg3_napi_disable() is called twice without
a tg3_napi_enable between. Once during tg3_io_error_detected() and again
during tg3_close(). The tg3_io_resume() then hangs on rtnl_lock().

v2: Added logging messages per Prashant's request

Cc: Prashant Sreedharan <prashant@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>

Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
Acked-by: default avatarPrashant Sreedharan <prashant@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 88e41947
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