Skip to content

Commit

Permalink
cxgb4vf: Turn off SGE RX/TX Callback Timers and interrupts in PCI shu…
Browse files Browse the repository at this point in the history
…tdown 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>
  • Loading branch information
Hariprasad Shenai authored and David S. Miller committed Aug 5, 2014
1 parent 6ff4e36 commit c2a1985
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2876,31 +2876,32 @@ 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;
}

/*
* Free up all Queues which will prevent further DMA and
* Interrupts allowing various internal pathways to drain.
*/
t4vf_free_sge_resources(adapter);
pci_set_drvdata(pdev, NULL);
}

/*
Expand Down

0 comments on commit c2a1985

Please sign in to comment.