bnx2: Use netif_carrier_off() to prevent timeout.
authorMichael Chan <mchan@broadcom.com>
Tue, 18 May 2010 00:34:43 +0000 (17:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 May 2010 00:34:43 +0000 (17:34 -0700)
commita0ba676008d9f050f1de9ede8d1ee4bf6820bfc9
tree46aa7a4dc2c110ee0d211b384eda91adc7729ad9
parenta931d294042b5bbd8e390c59741b968c11856ac1
bnx2: Use netif_carrier_off() to prevent timeout.

Based on original patch from Stanislaw Gruszka <sgruszka@redhat.com>.

Using netif_carrier_off() is better than updating all the ->trans_start
on all the tx queues.

netif_carrier_off() needs to be called after bnx2_disable_int_sync()
to guarantee no race conditions with the serdes timers that can
modify the carrier state.

If the chip or phy is reset, carrier will turn back on when we get the
link interrupt.  If there is no reset, we need to turn carrier back on
in bnx2_netif_start().  Again, the phy_lock prevents race conditions with
the serdes timers.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c