diff mbox

[next,S28,12/15] i40evf: set adapter state on reset failure

Message ID 1452897202-15204-13-git-send-email-joshua.a.hay@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Joshua Hay Jan. 15, 2016, 10:33 p.m. UTC
From: Mitch Williams <mitch.a.williams@intel.com>

If a reset fails to complete, the driver gets its affairs in order and
awaits the cold solace of rmmod. Unfortunately, it was not properly
setting the adapter state, which would cause a panic on rmmod, instead
of the desired surcease.

Set the adapter state to DOWN in this case, and avoid a panic.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: I6fdd9906da52e023f8dc744f7da44b5d95278ca9
---
Testing Hints: Execute CORER on the PF and see if you can get into
the state where the VF reset never completed. Then rmmod i40evf.

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bowers, AndrewX Jan. 21, 2016, 12:24 a.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
> Behalf Of Joshua Hay
> Sent: Friday, January 15, 2016 2:33 PM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S28 12/15] i40evf: set adapter state on
> reset failure
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> If a reset fails to complete, the driver gets its affairs in order and awaits the
> cold solace of rmmod. Unfortunately, it was not properly setting the adapter
> state, which would cause a panic on rmmod, instead of the desired surcease.
> 
> Set the adapter state to DOWN in this case, and avoid a panic.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Change-ID: I6fdd9906da52e023f8dc744f7da44b5d95278ca9
> ---
> Testing Hints: Execute CORER on the PF and see if you can get into the state
> where the VF reset never completed. Then rmmod i40evf.
> 
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 1 +
>  1 file changed, 1 insertion(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, no errors/panics detected after multiple resets
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 2b3c81b..6fcf9af 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1883,6 +1883,7 @@  static void i40evf_reset_task(struct work_struct *work)
 		adapter->netdev->flags &= ~IFF_UP;
 		clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
 		adapter->flags &= ~I40EVF_FLAG_RESET_PENDING;
+		adapter->state = __I40EVF_DOWN;
 		dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n");
 		return; /* Do not attempt to reinit. It's dead, Jim. */
 	}