summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Williams2014-04-01 09:11:50 +0200
committerJeff Kirsher2014-04-28 14:00:46 +0200
commit169f40760ec5e96b9c2e8718ae8f407f5c1e3fc6 (patch)
tree6d39833a19df48255fcb8c5115303cc6bb21103a
parenti40e: Don't stop driver probe when querying DCB config fails (diff)
downloadkernel-qcow2-linux-169f40760ec5e96b9c2e8718ae8f407f5c1e3fc6.tar.gz
kernel-qcow2-linux-169f40760ec5e96b9c2e8718ae8f407f5c1e3fc6.tar.xz
kernel-qcow2-linux-169f40760ec5e96b9c2e8718ae8f407f5c1e3fc6.zip
i40evf: fix panic on PF driver fail
Fix a panic that would occur in the VF if the PF driver failed or was removed from the host kernel. In this case, the VF driver calls i40evf_close(), but this function does nothing because the driver is in the resetting state. Because of this, the driver doesn't free its irqs and causes a kernel panic when it tries to disable MSI-X. Change-ID: If95644a89e554b4d7be0dca1b6add26f63047129 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index da6054cbd9c0..d7abd0dd2f73 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -25,6 +25,8 @@
#include "i40e_prototype.h"
static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter);
static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter);
+static void i40evf_free_all_tx_resources(struct i40evf_adapter *adapter);
+static void i40evf_free_all_rx_resources(struct i40evf_adapter *adapter);
static int i40evf_close(struct net_device *netdev);
char i40evf_driver_name[] = "i40evf";
@@ -1534,9 +1536,13 @@ static void i40evf_reset_task(struct work_struct *work)
rstat_val);
adapter->flags |= I40EVF_FLAG_PF_COMMS_FAILED;
- if (netif_running(adapter->netdev))
- i40evf_close(adapter->netdev);
-
+ if (netif_running(adapter->netdev)) {
+ set_bit(__I40E_DOWN, &adapter->vsi.state);
+ i40evf_down(adapter);
+ i40evf_free_traffic_irqs(adapter);
+ i40evf_free_all_tx_resources(adapter);
+ i40evf_free_all_rx_resources(adapter);
+ }
i40evf_free_misc_irq(adapter);
i40evf_reset_interrupt_capability(adapter);
i40evf_free_queues(adapter);