From 25858fdbdc58e713b056ada96d231dc57812aba4 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Apr 02 2015 00:30:48 +0000 Subject: Backport patch to fix tg3 deadlock (rhbz 1207789) --- diff --git a/kernel.spec b/kernel.spec index bc657ed..43d9951 100644 --- a/kernel.spec +++ b/kernel.spec @@ -664,6 +664,9 @@ Patch26175: xen-pciback-Don-t-disable-PCI_COMMAND-on-PCI-device-.patch #rhbz 1203913 Patch26176: sunrpc-make-debugfs-file-creation-failure-non-fatal.patch +#rhbz 1207789 +Patch26177: tg3-Hold-tp-lock-before-calling-tg3_halt-from-tg3_in.patch + # END OF PATCH DEFINITIONS %endif @@ -1436,6 +1439,9 @@ ApplyPatch xen-pciback-Don-t-disable-PCI_COMMAND-on-PCI-device-.patch #rhbz 1203913 ApplyPatch sunrpc-make-debugfs-file-creation-failure-non-fatal.patch +#rhbz 1207789 +ApplyPatch tg3-Hold-tp-lock-before-calling-tg3_halt-from-tg3_in.patch + # END OF PATCH APPLICATIONS %endif @@ -2296,6 +2302,7 @@ fi # || || %changelog * Wed Apr 01 2015 Josh Boyer +- Backport patch to fix tg3 deadlock (rhbz 1207789) - Fix gssproxy (rhbz 1203913) - CVE-2015-2150 xen: NMIs triggerable by guests (rhbz 1196266 1200397) diff --git a/tg3-Hold-tp-lock-before-calling-tg3_halt-from-tg3_in.patch b/tg3-Hold-tp-lock-before-calling-tg3_halt-from-tg3_in.patch new file mode 100644 index 0000000..b65d0a0 --- /dev/null +++ b/tg3-Hold-tp-lock-before-calling-tg3_halt-from-tg3_in.patch @@ -0,0 +1,44 @@ +From: "Jun'ichi Nomura \\(NEC\\)" +Date: Thu, 12 Feb 2015 01:26:24 +0000 +Subject: [PATCH] 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: + [] 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 +Signed-off-by: David S. Miller +--- + 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 96bf01ba32dd..05ae12690117 100644 +--- a/drivers/net/ethernet/broadcom/tg3.c ++++ b/drivers/net/ethernet/broadcom/tg3.c +@@ -17868,8 +17868,10 @@ static int tg3_init_one(struct pci_dev *pdev, + */ + if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) || + (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { ++ tg3_full_lock(tp, 0); + tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); + tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); ++ tg3_full_unlock(tp); + } + + err = tg3_test_dma(tp); +-- +2.1.0 +