]> git.baikalelectronics.ru Git - kernel.git/commit
net: pcs: xpcs: also ignore phy id if it's all ones
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 11 Jun 2021 20:05:24 +0000 (23:05 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:43:55 +0000 (13:43 -0700)
commit5d108c4dbddd4de57a38e21525c6299db9e29967
tree41acc27c993b43cac0f7624d57450cd5927fe8df
parent9912dd81f011955eebec97a74d1195f6dd8d352a
net: pcs: xpcs: also ignore phy id if it's all ones

xpcs_get_id() searches multiple MMDs for a known PHY ID, starting with
MDIO_MMD_PCS (3). However not all integrators might have implemented
that MMD on their MDIO bus. For example, the NXP SJA1105 and SJA1110
switches only implement vendor-specific MMD 1 and 2.

When there is nothing on an MDIO bus at a certain address, traditionally
the bus returns 0xffff, which means that the bus remained in its default
pull-up state for the duration of the MDIO transaction. The 0xffff value
is widely used in drivers/net/phy/phy_device.c (see get_phy_c22_id for
example) to denote a missing device.

So it makes sense for the xpcs to ignore this value as well, and
continue its search, eventually finding the proper PHY ID in the
vendor-specific MMDs.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs.c