]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: fec: fix ethtool set_pauseparam duplex bug
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Jul 2014 23:22:39 +0000 (00:22 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 04:21:21 +0000 (21:21 -0700)
Setting the pause parameters causes a running network interface to be
restarted.  However, the restart forces the FEC into half-duplex mode,
whether or not the remote end is in half-duplex mode.  Misconfigured
duplex mode is a known source of problems on a link.

Fix this by always preserving the duplex mode on configuration changes.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index a91fe68030e6dc3410fed51451159db35306e9d0..045ea71f2b5962622ec0dcab96e81016b2225956 100644 (file)
@@ -1897,7 +1897,7 @@ static int fec_enet_set_pauseparam(struct net_device *ndev,
                phy_start_aneg(fep->phy_dev);
        }
        if (netif_running(ndev))
-               fec_restart(ndev, 0);
+               fec_restart(ndev, fep->full_duplex);
 
        return 0;
 }