From 6224dddff248c8c2870061195aed015df77bee08 Mon Sep 17 00:00:00 2001 From: Jonathan Toppins Date: Fri, 6 Dec 2019 20:12:45 -0500 Subject: [PATCH 89/96] [netdrv] bnxt_en: Avoid disabling pci device in bnxt_remove_one() for already disabled device Message-id: Patchwork-id: 291383 O-Subject: [PATCH rhel8 05/13] bnxt_en: Avoid disabling pci device in bnxt_remove_one() for already disabled device. Bugzilla: 1773724 RH-Acked-by: Steve Best RH-Acked-by: David Arcari RH-Acked-by: Jarod Wilson RH-Acked-by: John Linville 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 Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski (cherry picked from commit f6824308c4be25ba024ab942a6135aa0356acaea) Bugzilla: 1773724 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=25154853 Tested: simple boot test Signed-off-by: Jonathan Toppins Signed-off-by: Bruno Meneguele --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.c =================================================================== --- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.c 2020-02-06 16:23:22.071454764 +0100 +++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c 2020-02-06 16:23:22.325452432 +0100 @@ -10387,7 +10387,8 @@ { 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)