i40evf: set adapter state on reset failure
authorMitch Williams <mitch.a.williams@intel.com>
Fri, 15 Jan 2016 22:33:19 +0000 (14:33 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 18 Feb 2016 07:36:08 +0000 (23:36 -0800)
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.

Change-ID: I6fdd9906da52e023f8dc744f7da44b5d95278ca9
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index 1176326cfb010d0b69fa2c806c281861bbb59a0e..cbb7507d40f4c4feaa7d0c281bd5f4ab68bc8f9b 100644 (file)
@@ -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. */
        }