[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231211185804.18668-5-shannon.nelson@amd.com>
Date: Mon, 11 Dec 2023 10:58:00 -0800
From: Shannon Nelson <shannon.nelson@....com>
To: <netdev@...r.kernel.org>, <davem@...emloft.net>, <kuba@...nel.org>,
<edumazet@...gle.com>, <pabeni@...hat.com>
CC: <brett.creeley@....com>, <drivers@...sando.io>, Shannon Nelson
<shannon.nelson@....com>
Subject: [PATCH net-next 4/8] ionic: prevent pci disable of already disabled device
If a reset fails, the PCI device is left in a disabled
state, so don't try to disable it again on driver remove.
This prevents a scary looking WARN trace in the kernel log.
ionic 0000:2b:00.0: disabling already-disabled device
Signed-off-by: Shannon Nelson <shannon.nelson@....com>
Reviewed-by: Brett Creeley <brett.creeley@....com>
---
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
index f69178b9636f..da951dc7becb 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
@@ -217,7 +217,9 @@ static void ionic_clear_pci(struct ionic *ionic)
{
ionic_unmap_bars(ionic);
pci_release_regions(ionic->pdev);
- pci_disable_device(ionic->pdev);
+
+ if (atomic_read(&ionic->pdev->enable_cnt) > 0)
+ pci_disable_device(ionic->pdev);
}
static int ionic_setup_one(struct ionic *ionic)
--
2.17.1
Powered by blists - more mailing lists