summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igbvf/ethtool.c
diff options
context:
space:
mode:
authorGreg Edwards <gedwards@ddn.com>2017-07-20 10:00:57 -0600
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2017-08-08 17:59:03 -0700
commit32652c2ac2f330d2c159d8259f359da0ee2b0aa3 (patch)
tree8b41043e18e752a0d20a3ba601a8dcc1e382c2b1 /drivers/net/ethernet/intel/igbvf/ethtool.c
parent48f76b68f9fca4e1d5bbb1755d14e8e8e09bdd5b (diff)
igbvf: add lock around mailbox ops
The PF driver assumes the VF will not send another mailbox message until the PF has written its reply to the previous message. If the VF does, that message will be silently dropped by the PF before it writes its reply to the mailbox. This results in a VF mailbox timeout for posted messages waiting for an ACK, and the VF is reset by the igbvf_watchdog_task in the VM. Add a lock around the VF mailbox ops to prevent the VF from sending another message while the PF is still processing the previous one. Signed-off-by: Greg Edwards <gedwards@ddn.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igbvf/ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/igbvf/ethtool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c
index 34faa113a8a0..a127688e83e6 100644
--- a/drivers/net/ethernet/intel/igbvf/ethtool.c
+++ b/drivers/net/ethernet/intel/igbvf/ethtool.c
@@ -296,8 +296,12 @@ static int igbvf_link_test(struct igbvf_adapter *adapter, u64 *data)
struct e1000_hw *hw = &adapter->hw;
*data = 0;
+ spin_lock_bh(&hw->mbx_lock);
+
hw->mac.ops.check_for_link(hw);
+ spin_unlock_bh(&hw->mbx_lock);
+
if (!(er32(STATUS) & E1000_STATUS_LU))
*data = 1;