]> git.openfabrics.org - ~shefty/rdma-dev.git/commit
sfc: Never try to stop and start a NIC that is disabled
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 27 Jul 2012 19:46:41 +0000 (20:46 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 24 Aug 2012 19:10:20 +0000 (20:10 +0100)
commit8b7325b4e29256881117aff8a162e829c79b47e9
tree5fc745835f9b5416fdc0d9fcc3abda51910e4b57
parent5642ceef466365ebc94eb1332d9e6228efa09518
sfc: Never try to stop and start a NIC that is disabled

efx_change_mtu() and efx_realloc_channels() each stop and start much
of the NIC, even if it has been disabled.  Since efx_start_all() is a
no-op when the NIC is disabled, this is probably harmless in the case
of efx_change_mtu(), but efx_realloc_channels() also reenables
interrupts which could be a bad thing to do.

Change efx_start_all() and efx_start_interrupts() to assert that the
NIC is not disabled, but make efx_stop_interrupts() do nothing if the
NIC is disabled (since it is already stopped), consistent with
efx_stop_all().

Update comments for efx_start_all() and efx_stop_all() to describe
their purpose and preconditions more accurately.

Add a common function to check and log if the NIC is disabled, and use
it in efx_net_open(), efx_change_mtu() and efx_realloc_channels().

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