Message ID | 20231211185804.18668-5-shannon.nelson@amd.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 13943d6c82730a2a4e40e05d6deaca26a8de0a4d |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ionic: updates to PCI error handling | expand |
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)