Skip to content

Commit

Permalink
net: dsa: do not use slave MII bus for fixed PHYs
Browse files Browse the repository at this point in the history
Commit cd28a1a ("net: dsa: fully divert PHY reads/writes if
requested") introduced a check for particular PHYs that need to be
accessed using the slave MII bus created by DSA, but this check was too
inclusive. This would prevent fixed PHYs from being successfully
registered because those should not go through the slave MII bus created
by DSA.

Make sure we check that the PHY is not a fixed PHY to prevent that from
happening.

Fixes: cd28a1a ("net: dsa: fully divert PHY reads/writes if requested")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Mar 14, 2015
1 parent 316ad4b commit 96026d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,8 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p,
* want to bind this device using the slave MII bus created by
* DSA to make that happen.
*/
if (ret >= 0 && (ds->phys_mii_mask & (1 << ret))) {
if (!phy_is_fixed && ret >= 0 &&
(ds->phys_mii_mask & (1 << ret))) {
ret = dsa_slave_phy_connect(p, slave_dev, ret);
if (ret)
return ret;
Expand Down

0 comments on commit 96026d0

Please sign in to comment.