All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net 3/5] bnxt_en: Improve AER slot reset.
Date: Sun, 26 Apr 2020 16:24:40 -0400	[thread overview]
Message-ID: <1587932682-1212-4-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1587932682-1212-1-git-send-email-michael.chan@broadcom.com>

Improve the slot reset sequence by disabling the device to prevent bad
DMAs if slot reset fails.  Return the proper result instead of always
PCI_ERS_RESULT_RECOVERED to the caller.

Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index fead64f..d8db08e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -12212,12 +12212,15 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
 		bnxt_ulp_start(bp, err);
 	}
 
-	if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
-		dev_close(netdev);
+	if (result != PCI_ERS_RESULT_RECOVERED) {
+		if (netif_running(netdev))
+			dev_close(netdev);
+		pci_disable_device(pdev);
+	}
 
 	rtnl_unlock();
 
-	return PCI_ERS_RESULT_RECOVERED;
+	return result;
 }
 
 /**
-- 
2.5.1


  parent reply	other threads:[~2020-04-26 20:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 20:24 [PATCH net 0/5] bnxt_en: Bug fixes Michael Chan
2020-04-26 20:24 ` [PATCH net 1/5] bnxt_en: Fix VF anti-spoof filter setup Michael Chan
2020-04-26 20:24 ` [PATCH net 2/5] bnxt_en: Reduce BNXT_MSIX_VEC_MAX value to supported CQs per PF Michael Chan
2020-04-26 20:24 ` Michael Chan [this message]
2020-04-26 20:24 ` [PATCH net 4/5] bnxt_en: Return error when allocating zero size context memory Michael Chan
2020-04-26 20:24 ` [PATCH net 5/5] bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features() Michael Chan
2020-04-27 18:45 ` [PATCH net 0/5] bnxt_en: Bug fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587932682-1212-4-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.