ice: fix driver unload flow
authorBruce Allan <bruce.w.allan@intel.com>
Wed, 9 Oct 2019 14:09:44 +0000 (07:09 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 7 Nov 2019 00:41:45 +0000 (16:41 -0800)
As part of the driver unload flow, a PF reset is issued which may still
cause an interrupt to be generated by the device.  Do not clear the
interrupt scheme until the reset is complete and there are no pending
transactions otherwise a hardware error may occur.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index 363b284..f29f575 100644 (file)
@@ -3348,12 +3348,13 @@ static void ice_remove(struct pci_dev *pdev)
        }
        ice_deinit_pf(pf);
        ice_deinit_hw(&pf->hw);
-       ice_clear_interrupt_scheme(pf);
        /* Issue a PFR as part of the prescribed driver unload flow.  Do not
         * do it via ice_schedule_reset() since there is no need to rebuild
         * and the service task is already stopped.
         */
        ice_reset(&pf->hw, ICE_RESET_PFR);
+       pci_wait_for_pending_transaction(pdev);
+       ice_clear_interrupt_scheme(pf);
        pci_disable_pcie_error_reporting(pdev);
 }