Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Fainelli and committed by
David S. Miller
733a969a 2eabd764

+1 -1
+1 -1
drivers/net/phy/bcm-phy-lib.c
··· 56 56 /* The register must be written to both the Shadow Register Select and 57 57 * the Shadow Read Register Selector 58 58 */ 59 - phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | 59 + phy_write(phydev, MII_BCM54XX_AUX_CTL, MII_BCM54XX_AUXCTL_SHDWSEL_MASK | 60 60 regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT); 61 61 return phy_read(phydev, MII_BCM54XX_AUX_CTL); 62 62 }