diff options
author | Jun'ichi Nomura \(NEC\) <j-nomura@ce.jp.nec.com> | 2015-02-11 20:26:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-11 22:51:08 -0500 |
commit | d0af71a3573f1217b140c60b66f1a9b335fb058b (patch) | |
tree | 9ff0a8a40744df0ab52f64e3eb1f16dc67855f07 /drivers/net/ethernet/broadcom/tg3.c | |
parent | b3b482c6e2259729ca8ab25eb488373abbc4675d (diff) |
tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one()
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: 932f19de ("tg3: Release tp->lock before invoking synchronize_irq()")
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 615a6dbde047..23a019cee279 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -17855,8 +17855,10 @@ static int tg3_init_one(struct pci_dev *pdev, | |||
17855 | */ | 17855 | */ |
17856 | if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) || | 17856 | if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) || |
17857 | (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { | 17857 | (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { |
17858 | tg3_full_lock(tp, 0); | ||
17858 | tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); | 17859 | tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); |
17859 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); | 17860 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
17861 | tg3_full_unlock(tp); | ||
17860 | } | 17862 | } |
17861 | 17863 | ||
17862 | err = tg3_test_dma(tp); | 17864 | err = tg3_test_dma(tp); |