sfc: Do not attempt to flush queues if DMA is disabled
authorStuart Hodgson <smhodgson@solarflare.com>
Fri, 30 Mar 2012 12:04:51 +0000 (13:04 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Thu, 10 May 2012 01:22:08 +0000 (02:22 +0100)
efx_nic_fatal_interrupt() disables DMA before scheduling a reset.
After this, we need not and *cannot* flush queues.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/efx.c

index 3cbfbffe3f006b00d598c57b5b46fa977248f2ad..5cc58a3b75ac7f48866fdf14b79bf2fb1656d26f 100644 (file)
@@ -656,25 +656,30 @@ static void efx_stop_datapath(struct efx_nic *efx)
        struct efx_channel *channel;
        struct efx_tx_queue *tx_queue;
        struct efx_rx_queue *rx_queue;
+       struct pci_dev *dev = efx->pci_dev;
        int rc;
 
        EFX_ASSERT_RESET_SERIALISED(efx);
        BUG_ON(efx->port_enabled);
 
-       rc = efx_nic_flush_queues(efx);
-       if (rc && EFX_WORKAROUND_7803(efx)) {
-               /* Schedule a reset to recover from the flush failure. The
-                * descriptor caches reference memory we're about to free,
-                * but falcon_reconfigure_mac_wrapper() won't reconnect
-                * the MACs because of the pending reset. */
-               netif_err(efx, drv, efx->net_dev,
-                         "Resetting to recover from flush failure\n");
-               efx_schedule_reset(efx, RESET_TYPE_ALL);
-       } else if (rc) {
-               netif_err(efx, drv, efx->net_dev, "failed to flush queues\n");
-       } else {
-               netif_dbg(efx, drv, efx->net_dev,
-                         "successfully flushed all queues\n");
+       /* Only perform flush if dma is enabled */
+       if (dev->is_busmaster) {
+               rc = efx_nic_flush_queues(efx);
+
+               if (rc && EFX_WORKAROUND_7803(efx)) {
+                       /* Schedule a reset to recover from the flush failure. The
+                        * descriptor caches reference memory we're about to free,
+                        * but falcon_reconfigure_mac_wrapper() won't reconnect
+                        * the MACs because of the pending reset. */
+                       netif_err(efx, drv, efx->net_dev,
+                                 "Resetting to recover from flush failure\n");
+                       efx_schedule_reset(efx, RESET_TYPE_ALL);
+               } else if (rc) {
+                       netif_err(efx, drv, efx->net_dev, "failed to flush queues\n");
+               } else {
+                       netif_dbg(efx, drv, efx->net_dev,
+                                 "successfully flushed all queues\n");
+               }
        }
 
        efx_for_each_channel(channel, efx) {