netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, vasundhara-v.volam@broadcom.com
Subject: [PATCH net 5/5] bnxt_en: Avoid disabling pci device in bnxt_remove_one() for already disabled device.
Date: Mon, 21 Oct 2019 01:34:29 -0400	[thread overview]
Message-ID: <1571636069-14179-6-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1571636069-14179-1-git-send-email-michael.chan@broadcom.com>

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

With the recently added error recovery logic, the device may already
be disabled if the firmware recovery is unsuccessful.  In
bnxt_remove_one(), check that the device is still enabled first
before calling pci_disable_device().

Fixes: 3bc7d4a352ef ("bnxt_en: Add BNXT_STATE_IN_FW_RESET state.")
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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 8492618..04ec909 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10382,7 +10382,8 @@ static void bnxt_cleanup_pci(struct bnxt *bp)
 {
 	bnxt_unmap_bars(bp, bp->pdev);
 	pci_release_regions(bp->pdev);
-	pci_disable_device(bp->pdev);
+	if (pci_is_enabled(bp->pdev))
+		pci_disable_device(bp->pdev);
 }
 
 static void bnxt_init_dflt_coal(struct bnxt *bp)
-- 
2.5.1


  parent reply	other threads:[~2019-10-21  5:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  5:34 [PATCH net 0/5] bnxt_en: Bug fixes Michael Chan
2019-10-21  5:34 ` [PATCH net 1/5] bnxt_en: Fix the size of devlink MSIX parameters Michael Chan
2019-10-21  5:34 ` [PATCH net 2/5] bnxt_en: Fix devlink NVRAM related byte order related issues Michael Chan
2019-10-22  4:14   ` Jakub Kicinski
2019-10-22  5:38     ` Michael Chan
2019-10-21  5:34 ` [PATCH net 3/5] bnxt_en: Adjust the time to wait before polling firmware readiness Michael Chan
2019-10-21  5:34 ` [PATCH net 4/5] bnxt_en: Minor formatting changes in FW devlink_health_reporter Michael Chan
2019-10-21  5:34 ` Michael Chan [this message]
2019-10-22 20:29 ` [PATCH net 0/5] bnxt_en: Bug fixes Jakub Kicinski

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=1571636069-14179-6-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vasundhara-v.volam@broadcom.com \
    /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 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).