[SRU][B][PATCH 1/1] tg3: prevent scheduling while atomic splat

Luke Nowakowski-Krijger luke.nowakowskikrijger at canonical.com
Wed Nov 9 13:19:52 UTC 2022


From: Jonathan Toppins <jtoppins at redhat.com>

BugLink: https://bugs.launchpad.net/bugs/1995870

The problem was introduced in commit
506b0a395f26 ("[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: 506b0a395f26 ("[netdrv] tg3: APE heartbeat changes")
Signed-off-by: Jonathan Toppins <jtoppins at redhat.com>
Acked-by: Michael Chan <michael.chan at broadcom.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry-picked from commit ea91df6d8a55836c740)
Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger at canonical.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index cd3db8559473..fd803a70a7bb 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -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;
 	}
 
-- 
2.34.1




More information about the kernel-team mailing list