]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: add locking around VF reset
authorMitch Williams <mitch.a.williams@intel.com>
Fri, 9 Jan 2015 11:18:15 +0000 (11:18 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 9 Feb 2015 04:11:44 +0000 (20:11 -0800)
commit445c07b3903ebe10a64fc2e2798d01b842fbf504
tree283c7c13f9397dfce443ef0ee97e097921db6d04
parentc8e19e975e406ec0a6d4cbeb4923683902d69c0e
i40e: add locking around VF reset

During VF deallocation, we need to lock out the VF reset code. However,
we cannot depend on simply masking the interrupt, as this does not lock
out the service task, which can still call the reset routine. Instead,
leave the interrupt enabled, but add locking around the VF disable and
reset routines.

For the disable code, we wait to get the lock, as the reset code will
take a finite amount of time to run. For the reset code, we just return
if we fail to get the lock. Since we know that the VFs are being
disabled, we don't need to handle the reset.
This fixes a panic when disabling SR-IOV.

Change-ID: Iea0a6cdef35c331f48c6d5b2f8e6f0e86322e7d8
Signed-off-by: Mitch Williams <mitch.a.williams@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.h
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c