aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavid decotigny <decot@googlers.com>2012-08-24 13:22:52 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-30 13:04:27 -0400
commit1ff39eb66b6ba456995fa19185463d7753cd8798 (patch)
treeca9ca1c5f29ca4fa9392c2fa9e7ea95ed0a44bdf
parentba9aa134287f6a59886ea91e0dadaa8477dec9c2 (diff)
forcedeth: fix TX timeout caused by TX pause on down link
On some dual-port forcedeth devices such as MCP55 10de:0373 (rev a3), when autoneg & TX pause are enabled while port is connected but interface is down, the NIC will eventually freeze (TX timeouts, network unreachable). This patch ensures that TX pause is not configured in hardware when interface is down. The TX pause request will be honored when interface is later configured. Tested: - hardware is MCP55 device id 10de:0373 (rev a3), dual-port - eth0 connected and UP, eth1 connected but DOWN - without this patch, following sequence would brick NIC: ifconfig eth0 down ifconfig eth1 up ifconfig eth1 down ethtool -A eth1 autoneg off rx on tx off ifconfig eth1 up ifconfig eth1 down ethtool -A eth1 autoneg on rx on tx on ifconfig eth1 up ifconfig eth1 down ifup eth0 sleep 120 # or longer ethtool eth1 Just in case, sequence to un-brick: ifconfig eth0 down ethtool -A eth1 autoneg off rx on tx off ifconfig eth1 up ifconfig eth1 down ifup eth0 - with this patch: no TX timeout after "bricking" sequence above Details: - The following register accesses have been identified as the ones causing the NIC to freeze in "bricking" sequence above: - write NVREG_TX_PAUSEFRAME_ENABLE_V1 to eth1's register NvRegTxPauseFrame - write NVREG_MISC1_PAUSE_TX | NVREG_MISC1_FORCE to eth1's register NvRegMisc1 - write 0 to eth1's register NvRegTransmitterControl This is what this patch avoids. Signed-off-by: David Decotigny <decot@googlers.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 51d19d8cb47..8b82457c168 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -3409,7 +3409,7 @@ set_speed:
3409 3409
3410 pause_flags = 0; 3410 pause_flags = 0;
3411 /* setup pause frame */ 3411 /* setup pause frame */
3412 if (np->duplex != 0) { 3412 if (netif_running(dev) && (np->duplex != 0)) {
3413 if (np->autoneg && np->pause_flags & NV_PAUSEFRAME_AUTONEG) { 3413 if (np->autoneg && np->pause_flags & NV_PAUSEFRAME_AUTONEG) {
3414 adv_pause = adv & (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); 3414 adv_pause = adv & (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
3415 lpa_pause = lpa & (LPA_PAUSE_CAP | LPA_PAUSE_ASYM); 3415 lpa_pause = lpa & (LPA_PAUSE_CAP | LPA_PAUSE_ASYM);
@@ -5455,6 +5455,7 @@ static int nv_close(struct net_device *dev)
5455 5455
5456 netif_stop_queue(dev); 5456 netif_stop_queue(dev);
5457 spin_lock_irq(&np->lock); 5457 spin_lock_irq(&np->lock);
5458 nv_update_pause(dev, 0); /* otherwise stop_tx bricks NIC */
5458 nv_stop_rxtx(dev); 5459 nv_stop_rxtx(dev);
5459 nv_txrx_reset(dev); 5460 nv_txrx_reset(dev);
5460 5461