Skip to content

Commit b6cfffa

Browse files
Bhadram Varkadavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bc8a2d9 commit b6cfffa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
928928
static int stmmac_init_phy(struct net_device *dev)
929929
{
930930
struct stmmac_priv *priv = netdev_priv(dev);
931+
u32 tx_cnt = priv->plat->tx_queues_to_use;
931932
struct phy_device *phydev;
932933
char phy_id_fmt[MII_BUS_ID_SIZE + 3];
933934
char bus_id[MII_BUS_ID_SIZE];
@@ -968,6 +969,15 @@ static int stmmac_init_phy(struct net_device *dev)
968969
phydev->advertising &= ~(SUPPORTED_1000baseT_Half |
969970
SUPPORTED_1000baseT_Full);
970971

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+
971981
/*
972982
* Broken HW is sometimes missing the pull-up resistor on the
973983
* MDIO line, which results in reads to non-existent devices returning

0 commit comments

Comments
 (0)