]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sfc: Hold RTNL lock (only) when calling efx_stop_interrupts()
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 27 Jul 2012 18:35:52 +0000 (19:35 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 24 Aug 2012 19:10:20 +0000 (20:10 +0100)
Interrupt state should be consistently guarded by the RTNL lock once
the net device is registered.

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

index f02591bb62f479c4fecdb9cc074bf3f646df0da2..629029e2037d1697774eee0da8fb2f311a3c5433 100644 (file)
@@ -2164,9 +2164,9 @@ void efx_reset_down(struct efx_nic *efx, enum reset_type method)
        EFX_ASSERT_RESET_SERIALISED(efx);
 
        efx_stop_all(efx);
-       mutex_lock(&efx->mac_lock);
-
        efx_stop_interrupts(efx, false);
+
+       mutex_lock(&efx->mac_lock);
        if (efx->port_initialized && method != RESET_TYPE_INVISIBLE)
                efx->phy_op->fini(efx);
        efx->type->fini(efx);
@@ -2492,11 +2492,11 @@ static void efx_pci_remove(struct pci_dev *pci_dev)
        rtnl_lock();
        efx->state = STATE_UNINIT;
        dev_close(efx->net_dev);
+       efx_stop_interrupts(efx, false);
 
        /* Allow any queued efx_resets() to complete */
        rtnl_unlock();
 
-       efx_stop_interrupts(efx, false);
        efx_sriov_fini(efx);
        efx_unregister_netdev(efx);