]> git.hungrycats.org Git - linux/commit
tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one()
authorJun'ichi Nomura \\\\(NEC\\\\) <j-nomura@ce.jp.nec.com>
Thu, 12 Feb 2015 01:26:24 +0000 (01:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2015 08:23:44 +0000 (10:23 +0200)
commitedc7cc6c53c6aecbf493eabd7b8cf37f3eef6ea7
tree124252b1ae3884bf254de132c7625c07b231dae7
parentf1cb2a0f6b8cdc07fa540d53a00e93bac7118640
tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one()

[ Upstream commit d0af71a3573f1217b140c60b66f1a9b335fb058b ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/tg3.c