Skip to content

Commit 8d90991

Browse files
mwalledavem330
authored andcommitted
net: phy: mscc-miim: reject clause 45 register accesses
The driver doesn't support clause 45 register access yet, but doesn't check if the access is a c45 one either. This leads to spurious register reads and writes. Add the check. Fixes: 542671f ("net: phy: mscc-miim: Add MDIO driver") Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9386d18 commit 8d90991

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/net/mdio/mdio-mscc-miim.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ static int mscc_miim_read(struct mii_bus *bus, int mii_id, int regnum)
102102
u32 val;
103103
int ret;
104104

105+
if (regnum & MII_ADDR_C45)
106+
return -EOPNOTSUPP;
107+
105108
ret = mscc_miim_wait_pending(bus);
106109
if (ret)
107110
goto out;
@@ -145,6 +148,9 @@ static int mscc_miim_write(struct mii_bus *bus, int mii_id,
145148
struct mscc_miim_dev *miim = bus->priv;
146149
int ret;
147150

151+
if (regnum & MII_ADDR_C45)
152+
return -EOPNOTSUPP;
153+
148154
ret = mscc_miim_wait_pending(bus);
149155
if (ret < 0)
150156
goto out;

0 commit comments

Comments
 (0)