From: Mitch Williams Date: Thu, 10 Mar 2016 22:59:49 +0000 (-0800) Subject: i40evf: Add additional check for reset X-Git-Tag: v4.1.12-92~121^2~81 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=25b8061724e55921d58140d330dd32a2ad9bf63f;p=users%2Fjedix%2Flinux-maple.git i40evf: Add additional check for reset Orabug: 23176970 If the driver happens to read a register during the time in which the device is undergoing reset, it will receive a value of 0xdeadbeef instead of a valid value. Unfortunately, the driver may misinterpret this as a valid value, especially if it's just looking for individual bits. Add an explicit check for this value when we are looking for admin queue errors, and trigger reset recovery if we find it. Signed-off-by: Mitch Williams Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher (cherry picked from commit 19b73d8efaa459a66665b5e0a3e7acedd05f4901) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index 880bb06750dab..755ea3667eb54 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c @@ -1994,6 +1994,8 @@ static void i40evf_adminq_task(struct work_struct *work) /* check for error indications */ val = rd32(hw, hw->aq.arq.len); + if (val == 0xdeadbeef) /* indicates device in reset */ + goto freedom; oldval = val; if (val & I40E_VF_ARQLEN1_ARQVFE_MASK) { dev_info(&adapter->pdev->dev, "ARQ VF Error detected\n");