aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-05-27 18:59:59 +0300
committerJakub Kicinski <kuba@kernel.org>2021-05-28 15:21:13 -0700
commit4751d2aa321f2828d8c5d2f7ce4ed18a01e47f46 (patch)
treeeb0864bf2e00910e07c80d9ae135fee8b5d49941 /drivers/net/ethernet/realtek
parentnfc: st95hf: mark ACPI and OF device ID tables as maybe unused (diff)
downloadlinux-dev-4751d2aa321f2828d8c5d2f7ce4ed18a01e47f46.tar.xz
linux-dev-4751d2aa321f2828d8c5d2f7ce4ed18a01e47f46.zip
net: stmmac: the XPCS obscures a potential "PHY not found" error
stmmac_mdio_register() has logic to search for PHYs on the MDIO bus and assign them IRQ lines, as well as to set priv->plat->phy_addr. If no PHY is found, the "found" variable remains set to 0 and the function errors out. After the introduction of commit f213bbe8a9d6 ("net: stmmac: Integrate it with DesignWare XPCS"), the "found" variable was immediately reused for searching for a PCS on the same MDIO bus. This can result in 2 types of potential problems (none of them seems to be seen on the only Intel system that sets has_xpcs = true, otherwise it would have been reported): 1. If a PCS is found but a PHY is not, then the code happily exits with no error. One might say "yes, but this is not possible, because of_mdiobus_register will probe a PHY for all MDIO addresses, including for the XPCS, so if an XPCS exists, then a PHY certainly exists too". Well, that is not true, see intel_mgbe_common_data(): /* Ensure mdio bus scan skips intel serdes and pcs-xpcs */ plat->mdio_bus_data->phy_mask = 1 << INTEL_MGBE_ADHOC_ADDR; plat->mdio_bus_data->phy_mask |= 1 << INTEL_MGBE_XPCS_ADDR; 2. A PHY is found but an MDIO device with the XPCS PHY ID isn't, and in that case, the error message will be "No PHY found". Confusing. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20210527155959.3270478-1-olteanv@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/realtek')
0 files changed, 0 insertions, 0 deletions