summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHariprasad Shenai <hariprasad@chelsio.com>2014-08-05 14:11:28 +0400
committerDavid S. Miller <davem@davemloft.net>2014-08-06 03:40:40 +0400
commitc2a198569aeab71c36156f83128916dce9561741 (patch)
treeb35603434d794268fe7a66a5273cb07f27e7aa10 /drivers
parent6ff4e36f8b69540b99aac75964154e14e7d6a6db (diff)
downloadlinux-c2a198569aeab71c36156f83128916dce9561741.tar.xz
cxgb4vf: Turn off SGE RX/TX Callback Timers and interrupts in PCI shutdown routine
Need to turn off SGE RX/TX Callback Timers & interrupt in cxgb4vf PCI Shutdown routine in order to prevent crashes during reboot/poweroff when traffic is running. Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index f002af190a65..d8d28e82ade1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2876,24 +2876,24 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
if (!adapter)
return;
- /*
- * Disable all Virtual Interfaces. This will shut down the
+ /* Disable all Virtual Interfaces. This will shut down the
* delivery of all ingress packets into the chip for these
* Virtual Interfaces.
*/
- for_each_port(adapter, pidx) {
- struct net_device *netdev;
- struct port_info *pi;
-
- if (!test_bit(pidx, &adapter->registered_device_map))
- continue;
-
- netdev = adapter->port[pidx];
- if (!netdev)
- continue;
+ for_each_port(adapter, pidx)
+ if (test_bit(pidx, &adapter->registered_device_map))
+ unregister_netdev(adapter->port[pidx]);
- pi = netdev_priv(netdev);
- t4vf_enable_vi(adapter, pi->viid, false, false);
+ /* Free up all Queues which will prevent further DMA and
+ * Interrupts allowing various internal pathways to drain.
+ */
+ t4vf_sge_stop(adapter);
+ if (adapter->flags & USING_MSIX) {
+ pci_disable_msix(adapter->pdev);
+ adapter->flags &= ~USING_MSIX;
+ } else if (adapter->flags & USING_MSI) {
+ pci_disable_msi(adapter->pdev);
+ adapter->flags &= ~USING_MSI;
}
/*
@@ -2901,6 +2901,7 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
* Interrupts allowing various internal pathways to drain.
*/
t4vf_free_sge_resources(adapter);
+ pci_set_drvdata(pdev, NULL);
}
/*