Commit 13943d6c authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

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: default avatarShannon Nelson <shannon.nelson@amd.com>
Reviewed-by: default avatarBrett Creeley <brett.creeley@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ca5fdf9a
...@@ -217,6 +217,8 @@ static void ionic_clear_pci(struct ionic *ionic) ...@@ -217,6 +217,8 @@ static void ionic_clear_pci(struct ionic *ionic)
{ {
ionic_unmap_bars(ionic); ionic_unmap_bars(ionic);
pci_release_regions(ionic->pdev); pci_release_regions(ionic->pdev);
if (atomic_read(&ionic->pdev->enable_cnt) > 0)
pci_disable_device(ionic->pdev); pci_disable_device(ionic->pdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment