Skip to content

Commit

Permalink
tg3: prevent scheduling while atomic splat
Browse files Browse the repository at this point in the history
The problem was introduced in commit
506b0a3 ("[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: 506b0a3 ("[netdrv] tg3: APE heartbeat changes")
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jonathan Toppins authored and David S. Miller committed Mar 14, 2018
1 parent d52e5a7 commit ea91df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us)

tg3_ape_unlock(tp, TG3_APE_LOCK_MEM);

usleep_range(10, 20);
udelay(10);
timeout_us -= (timeout_us > 10) ? 10 : timeout_us;
}

Expand Down

0 comments on commit ea91df6

Please sign in to comment.