summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igbvf
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2015-12-12 03:45:38 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-02-16 03:17:57 +0300
commit9ce0e8d72678b5b60c99ce4c7af15ec127c761cb (patch)
tree93e81db74fb3c541bf6a003fe8df0d9fb6b515d7 /drivers/net/ethernet/intel/igbvf
parent37a5d163fb447b39f7960d0534de30e88ad395bb (diff)
downloadlinux-9ce0e8d72678b5b60c99ce4c7af15ec127c761cb.tar.xz
igb/igbvf: don't give up
The driver shouldn't just give up if it fails to get the hardware mailbox lock. This can happen in a situation where the PF-VF communication channel is heavily loaded and causes complete communications failure between the PF and VF drivers. Add a counter and a delay. The driver will now retry ten times, waiting one millisecond between retries. Signed-off-by: Mitch Williams <mitch.a.williams@intel.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')
-rw-r--r--drivers/net/ethernet/intel/igbvf/mbx.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/mbx.c b/drivers/net/ethernet/intel/igbvf/mbx.c
index 7b6cb4c3764c..01752f44ace2 100644
--- a/drivers/net/ethernet/intel/igbvf/mbx.c
+++ b/drivers/net/ethernet/intel/igbvf/mbx.c
@@ -234,13 +234,19 @@ static s32 e1000_check_for_rst_vf(struct e1000_hw *hw)
static s32 e1000_obtain_mbx_lock_vf(struct e1000_hw *hw)
{
s32 ret_val = -E1000_ERR_MBX;
-
- /* Take ownership of the buffer */
- ew32(V2PMAILBOX(0), E1000_V2PMAILBOX_VFU);
-
- /* reserve mailbox for VF use */
- if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU)
- ret_val = E1000_SUCCESS;
+ int count = 10;
+
+ do {
+ /* Take ownership of the buffer */
+ ew32(V2PMAILBOX(0), E1000_V2PMAILBOX_VFU);
+
+ /* reserve mailbox for VF use */
+ if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU) {
+ ret_val = 0;
+ break;
+ }
+ udelay(1000);
+ } while (count-- > 0);
return ret_val;
}