Skip to content

Commit

Permalink
ionic: prevent pci disable of already disabled device
Browse files Browse the repository at this point in the history
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@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Dec 13, 2023
1 parent ca5fdf9 commit 13943d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 13943d6

Please sign in to comment.