From: Mitch Williams Date: Fri, 15 Jan 2016 22:33:19 +0000 (-0800) Subject: i40evf: set adapter state on reset failure X-Git-Tag: v4.1.12-92~189^2~89 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=67f1c474722244466853df71b500b40c8fdcfd53;p=users%2Fjedix%2Flinux-maple.git i40evf: set adapter state on reset failure Orabug: 22342532 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 Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher (cherry picked from commit 9b9344f7ce19c5c481f203a0af3e120b965afcd9) 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 99a3ae2c926a3..39f65dc401b79 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. */ }