netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes.
@ 2020-02-20 22:26 Michael Chan
  2020-02-20 22:26 ` [PATCH net 1/2] bnxt_en: Improve device shutdown method Michael Chan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Chan @ 2020-02-20 22:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

2 small patches to fix kexec shutdown and kdump kernel driver init issues.

Please also queue these for -stable.  Thanks.

Vasundhara Volam (2):
  bnxt_en: Improve device shutdown method.
  bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

-- 
2.5.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] bnxt_en: Improve device shutdown method.
  2020-02-20 22:26 [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes Michael Chan
@ 2020-02-20 22:26 ` Michael Chan
  2020-02-20 22:26 ` [PATCH net 2/2] bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs Michael Chan
  2020-02-21  0:06 ` [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2020-02-20 22:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, Vasundhara Volam

From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>

Especially when bnxt_shutdown() is called during kexec, we need to
disable MSIX and disable Bus Master to completely quiesce the device.
Make these 2 calls unconditionally in the shutdown method.

Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 597e6fd..2ad007e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11983,10 +11983,10 @@ static void bnxt_shutdown(struct pci_dev *pdev)
 		dev_close(dev);
 
 	bnxt_ulp_shutdown(bp);
+	bnxt_clear_int_mode(bp);
+	pci_disable_device(pdev);
 
 	if (system_state == SYSTEM_POWER_OFF) {
-		bnxt_clear_int_mode(bp);
-		pci_disable_device(pdev);
 		pci_wake_from_d3(pdev, bp->wol);
 		pci_set_power_state(pdev, PCI_D3hot);
 	}
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs.
  2020-02-20 22:26 [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes Michael Chan
  2020-02-20 22:26 ` [PATCH net 1/2] bnxt_en: Improve device shutdown method Michael Chan
@ 2020-02-20 22:26 ` Michael Chan
  2020-02-21  0:06 ` [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2020-02-20 22:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, Vasundhara Volam

From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>

If crashed kernel does not shutdown the NIC properly, PCIe FLR
is required in the kdump kernel in order to initialize all the
functions properly.

Fixes: d629522e1d66 ("bnxt_en: Reduce memory usage when running in kdump kernel.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2ad007e..fd6e0e4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11786,6 +11786,14 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (version_printed++ == 0)
 		pr_info("%s", version);
 
+	/* Clear any pending DMA transactions from crash kernel
+	 * while loading driver in capture kernel.
+	 */
+	if (is_kdump_kernel()) {
+		pci_clear_master(pdev);
+		pcie_flr(pdev);
+	}
+
 	max_irqs = bnxt_get_max_irq(pdev);
 	dev = alloc_etherdev_mq(sizeof(*bp), max_irqs);
 	if (!dev)
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes.
  2020-02-20 22:26 [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes Michael Chan
  2020-02-20 22:26 ` [PATCH net 1/2] bnxt_en: Improve device shutdown method Michael Chan
  2020-02-20 22:26 ` [PATCH net 2/2] bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs Michael Chan
@ 2020-02-21  0:06 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-21  0:06 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Thu, 20 Feb 2020 17:26:33 -0500

> 2 small patches to fix kexec shutdown and kdump kernel driver init issues.

Applied.

> Please also queue these for -stable.  Thanks.

Queued up.

Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-21  0:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-20 22:26 [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes Michael Chan
2020-02-20 22:26 ` [PATCH net 1/2] bnxt_en: Improve device shutdown method Michael Chan
2020-02-20 22:26 ` [PATCH net 2/2] bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs Michael Chan
2020-02-21  0:06 ` [PATCH net 0/2] bnxt_en: shutdown and kexec/kdump related fixes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).