Skip to content

Commit dd69034

Browse files
nomuranecsashalevin
authored andcommitted
tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one()
[ Upstream commit d0af71a ] tg3_init_one() calls tg3_halt() without tp->lock despite its assumption and causes deadlock. If lockdep is enabled, a warning like this shows up before the stall: [ BUG: bad unlock balance detected! ] 3.19.0test #3 Tainted: G E ------------------------------------- insmod/369 is trying to release lock (&(&tp->lock)->rlock) at: [<ffffffffa02d5a1d>] tg3_chip_reset+0x14d/0x780 [tg3] but there are no more locks to release! tg3_init_one() doesn't call tg3_halt() under normal situation but during kexec kdump I hit this problem. Fixes: 932f19d ("tg3: Release tp->lock before invoking synchronize_irq()") Signed-off-by: Jun'ichi Nomura <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e083cde commit dd69034

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+2
-0
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17840,8 +17840,10 @@ static int tg3_init_one(struct pci_dev *pdev,
1784017840
*/
1784117841
if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) ||
1784217842
(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {
17843+
tg3_full_lock(tp, 0);
1784317844
tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
1784417845
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
17846+
tg3_full_unlock(tp);
1784517847
}
1784617848

1784717849
err = tg3_test_dma(tp);

0 commit comments

Comments
 (0)