Commit ea91df6d authored by Jonathan Toppins's avatar Jonathan Toppins Committed by David S. Miller

tg3: prevent scheduling while atomic splat

The problem was introduced in commit
506b0a39 ("[netdrv] tg3: APE heartbeat changes"). The bug occurs
because tp->lock spinlock is held which is obtained in tg3_start
by way of tg3_full_lock(), line 11571. The documentation for usleep_range()
specifically states it cannot be used inside a spinlock.

Fixes: 506b0a39 ("[netdrv] tg3: APE heartbeat changes")
Signed-off-by: default avatarJonathan Toppins <jtoppins@redhat.com>
Acked-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d52e5a7e
...@@ -820,7 +820,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us) ...@@ -820,7 +820,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us)
tg3_ape_unlock(tp, TG3_APE_LOCK_MEM); tg3_ape_unlock(tp, TG3_APE_LOCK_MEM);
usleep_range(10, 20); udelay(10);
timeout_us -= (timeout_us > 10) ? 10 : timeout_us; timeout_us -= (timeout_us > 10) ? 10 : timeout_us;
} }
......
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