aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igbvf/mbx.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/mbx.c
parente1000e: Initial Support for IceLake (diff)
downloadlinux-dev-32652c2ac2f330d2c159d8259f359da0ee2b0aa3.tar.xz
linux-dev-32652c2ac2f330d2c159d8259f359da0ee2b0aa3.zip
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/mbx.c')
-rw-r--r--drivers/net/ethernet/intel/igbvf/mbx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/mbx.c b/drivers/net/ethernet/intel/igbvf/mbx.c
index 01752f44ace2..c9a441632e9f 100644
--- a/drivers/net/ethernet/intel/igbvf/mbx.c
+++ b/drivers/net/ethernet/intel/igbvf/mbx.c
@@ -264,6 +264,8 @@ static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size)
s32 err;
u16 i;
+ WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock));
+
/* lock the mailbox to prevent pf/vf race condition */
err = e1000_obtain_mbx_lock_vf(hw);
if (err)
@@ -300,6 +302,8 @@ static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size)
s32 err;
u16 i;
+ WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock));
+
/* lock the mailbox to prevent pf/vf race condition */
err = e1000_obtain_mbx_lock_vf(hw);
if (err)