Skip to contentSkip to conversation

net: phy: broadcom: Fix auxiliary control register reads

PATCH In review Florian Fainelli 2 participants 2 messages May 22, 2018 – May 23, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: broadcom: Fix auxiliary control register reads

We are currently doing auxiliary control register reads with the shadow register value 0b111 (0x7) which incidentally is also the selector value that should be present in bits [2:0]. Fix this by using the appropriate selector mask which is defined (MII_BCM54XX_AUXCTL_SHDWSEL_MASK).

This does not have a functional impact yet because we always access the MII_BCM54XX_AUXCTL_SHDWSEL_MISC (0x7) register in the current code. This might change at some point though.

Fixes 5b4e29005123 ("net: phy: broadcom: add bcm54xx_auxctl_read")

---
David, please queue this for -stable as well, thank you!

 drivers/net/phy/bcm-phy-lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/bcm-phy-lib.c +1 -1
index 5ad130c3da43..d5e0833d69b9 100644
@@ -56,7 +56,7 @@ int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum)
 	/* The register must be written to both the Shadow Register Select and
 	 * the Shadow Read Register Selector
 	 */
-	phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum |
+	phy_write(phydev, MII_BCM54XX_AUX_CTL, MII_BCM54XX_AUXCTL_SHDWSEL_MASK |
 		  regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT);
 	return phy_read(phydev, MII_BCM54XX_AUX_CTL);
 }
Signature · 1 line
2.14.1
maintainer
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Tue, 22 May 2018 16:22:26 -0700

Quoted 5 lines

We are currently doing auxiliary control register reads with the shadow register value 0b111 (0x7) which incidentally is also the selector value that should be present in bits [2:0]. Fix this by using the appropriate selector mask which is defined (MII_BCM54XX_AUXCTL_SHDWSEL_MASK).

Quoted 8 lines

This does not have a functional impact yet because we always access the MII_BCM54XX_AUXCTL_SHDWSEL_MISC (0x7) register in the current code. This might change at some point though.

Fixes 5b4e29005123 ("net: phy: broadcom: add bcm54xx_auxctl_read")

---
David, please queue this for -stable as well, thank you!

Applied and queued up for -stable.