[REGRESSION][Vivid][PATCH 1/1] tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one()

Joseph Salisbury joseph.salisbury at canonical.com
Thu Mar 5 21:47:52 UTC 2015

From: "Jun'ichi Nomura \\(NEC\\)" <j-nomura at ce.jp.nec.com>

BugLink: http://bugs.launchpad.net/bugs/1428111

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 at ce.jp.nec.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit d0af71a3573f1217b140c60b66f1a9b335fb058b)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
 drivers/net/ethernet/broadcom/tg3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3ee78c6..b365f89 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -17869,8 +17869,10 @@ static int tg3_init_one(struct pci_dev *pdev,
+		tg3_full_lock(tp, 0);
 		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+		tg3_full_unlock(tp);
 	err = tg3_test_dma(tp);

More information about the kernel-team mailing list