sfc: do not device_attach if a reset is pending
efx_start_all can return without initialising queues as a reset is pending.
This means that when netif_device_attach is called, the kernel can start
sending traffic without having an initialised TX queue to send to.
This patch avoids this by not calling netif_device_attach if there is a
pending reset.
Fixes: e283546c04
("sfc:On MCDI timeout, issue an FLR (and mark MCDI to fail-fast)")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
105eac6c35
commit
9c568fd884
@@ -276,6 +276,12 @@ static inline void efx_device_detach_sync(struct efx_nic *efx)
|
||||
netif_tx_unlock_bh(dev);
|
||||
}
|
||||
|
||||
static inline void efx_device_attach_if_not_resetting(struct efx_nic *efx)
|
||||
{
|
||||
if ((efx->state != STATE_DISABLED) && !efx->reset_pending)
|
||||
netif_device_attach(efx->net_dev);
|
||||
}
|
||||
|
||||
static inline bool efx_rwsem_assert_write_locked(struct rw_semaphore *sem)
|
||||
{
|
||||
if (WARN_ON(down_read_trylock(sem))) {
|
||||
|
Reference in New Issue
Block a user