Skip to content

Commit 5799fc9

Browse files
fulong82davem330
authored andcommitted
net: stmmac: fix incorrect bit set in gmac4 mdio addr register
Fixing the gmac4 mdio write access to use MII_GMAC4_WRITE only instead of OR together with MII_WRITE. Signed-off-by: Kweh, Hock Leong <[email protected]> Acked-By: Joao Pinto <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 610c908 commit 5799fc9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
116116
unsigned int mii_address = priv->hw->mii.addr;
117117
unsigned int mii_data = priv->hw->mii.data;
118118

119-
u32 value = MII_WRITE | MII_BUSY;
119+
u32 value = MII_BUSY;
120120

121121
value |= (phyaddr << priv->hw->mii.addr_shift)
122122
& priv->hw->mii.addr_mask;
@@ -126,6 +126,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
126126
& priv->hw->mii.clk_csr_mask;
127127
if (priv->plat->has_gmac4)
128128
value |= MII_GMAC4_WRITE;
129+
else
130+
value |= MII_WRITE;
129131

130132
/* Wait until any existing MII operation is complete */
131133
if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))

0 commit comments

Comments
 (0)