sfc: Do not attempt to flush queues if DMA is disabled

[ Upstream commit 3dca9d2dc285faf1910d405b65df845cab061356 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Stuart Hodgson 2012-03-30 13:04:51 +01:00 committed by Greg Kroah-Hartman
parent 1280938465
commit be29fc5aa4
1 changed files with 19 additions and 14 deletions

View File

@ -656,12 +656,16 @@ static void efx_stop_datapath(struct efx_nic *efx)
struct efx_channel *channel; struct efx_channel *channel;
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
struct efx_rx_queue *rx_queue; struct efx_rx_queue *rx_queue;
struct pci_dev *dev = efx->pci_dev;
int rc; int rc;
EFX_ASSERT_RESET_SERIALISED(efx); EFX_ASSERT_RESET_SERIALISED(efx);
BUG_ON(efx->port_enabled); BUG_ON(efx->port_enabled);
/* Only perform flush if dma is enabled */
if (dev->is_busmaster) {
rc = efx_nic_flush_queues(efx); rc = efx_nic_flush_queues(efx);
if (rc && EFX_WORKAROUND_7803(efx)) { if (rc && EFX_WORKAROUND_7803(efx)) {
/* Schedule a reset to recover from the flush failure. The /* Schedule a reset to recover from the flush failure. The
* descriptor caches reference memory we're about to free, * descriptor caches reference memory we're about to free,
@ -676,6 +680,7 @@ static void efx_stop_datapath(struct efx_nic *efx)
netif_dbg(efx, drv, efx->net_dev, netif_dbg(efx, drv, efx->net_dev,
"successfully flushed all queues\n"); "successfully flushed all queues\n");
} }
}
efx_for_each_channel(channel, efx) { efx_for_each_channel(channel, efx) {
/* RX packet processing is pipelined, so wait for the /* RX packet processing is pipelined, so wait for the