i40e: disable IOV before freeing resources
authorMitch A Williams <mitch.a.williams@intel.com>
Tue, 9 Dec 2014 08:53:01 +0000 (08:53 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 13 Jan 2015 19:28:47 +0000 (11:28 -0800)
commit6a9ddb36eeb897807341fc92d35b71b2d5d6d67d
tree11fe74384d3fe29b4f9f512cb3a34b57f2c5b086
parent52e3ad9f011fe72620b2f7050227cd48fd295ad5
i40e: disable IOV before freeing resources

If VF drivers are loaded in the host OS, the call to pci_disable_sriov()
will cause these drivers' remove routines to be called. If the PF driver
has already freed VF resources before this happens, then the VF remove
routine can't properly communicate with the PF driver causing all sorts
of mayhem and error messages and hurt feelings.

To fix this, we move the call to pci_disable_sriov() up to the top of
the function and let it complete before freeing any VF resources.

Change-ID: I397c3997a00f6408e32b7735273911e499600236
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c