aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhadram Varka <vbhadram@nvidia.com>2018-06-17 10:32:05 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-20 01:35:20 -0400
commitb6cfffa7ad923c73f317ea50fd4ebcb3b4b6669c (patch)
treecd1acaf785acd38718cc7c6cdb4f4a5dc3a36a95
parentbc8a2d9bcbf1ca548b1deb315d14e1da81945bea (diff)
stmmac: fix DMA channel hang in half-duplex mode
HW does not support Half-duplex mode in multi-queue scenario. Fix it by not advertising the Half-Duplex mode if multi-queue enabled. Signed-off-by: Bhadram Varka <vbhadram@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e79b0d7b388a..cba46b62a1cd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -928,6 +928,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
928static int stmmac_init_phy(struct net_device *dev) 928static int stmmac_init_phy(struct net_device *dev)
929{ 929{
930 struct stmmac_priv *priv = netdev_priv(dev); 930 struct stmmac_priv *priv = netdev_priv(dev);
931 u32 tx_cnt = priv->plat->tx_queues_to_use;
931 struct phy_device *phydev; 932 struct phy_device *phydev;
932 char phy_id_fmt[MII_BUS_ID_SIZE + 3]; 933 char phy_id_fmt[MII_BUS_ID_SIZE + 3];
933 char bus_id[MII_BUS_ID_SIZE]; 934 char bus_id[MII_BUS_ID_SIZE];
@@ -969,6 +970,15 @@ static int stmmac_init_phy(struct net_device *dev)
969 SUPPORTED_1000baseT_Full); 970 SUPPORTED_1000baseT_Full);
970 971
971 /* 972 /*
973 * Half-duplex mode not supported with multiqueue
974 * half-duplex can only works with single queue
975 */
976 if (tx_cnt > 1)
977 phydev->supported &= ~(SUPPORTED_1000baseT_Half |
978 SUPPORTED_100baseT_Half |
979 SUPPORTED_10baseT_Half);
980
981 /*
972 * Broken HW is sometimes missing the pull-up resistor on the 982 * Broken HW is sometimes missing the pull-up resistor on the
973 * MDIO line, which results in reads to non-existent devices returning 983 * MDIO line, which results in reads to non-existent devices returning
974 * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent 984 * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent