linux/drivers/net/ethernet/stmicro/stmmac
Vladimir Oltean 4751d2aa32 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 f213bbe8a9 ("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>
2021-05-28 15:21:13 -07:00
..
altr_tse_pcs.c
altr_tse_pcs.h
chain_mode.c
common.h net: stmmac: Add HW descriptor prefetch setting for DWMAC Core 5.20 onwards 2021-04-22 15:02:40 -07:00
descs.h
descs_com.h
dwmac-anarion.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-dwc-qos-eth.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-generic.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-imx.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-intel-plat.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-intel.c net: stmmac: Add callbacks for DWC xpcs Energy Efficient Ethernet 2021-05-17 15:53:58 -07:00
dwmac-intel.h stmmac: intel: Enable SERDES PHY rx clk for PSE 2021-04-07 14:24:23 -07:00
dwmac-ipq806x.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-lpc18xx.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-mediatek.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-meson.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-meson8b.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-oxnas.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-qcom-ethqos.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-rk.c net: stmmac: Add RK3566/RK3568 SoC support 2021-05-17 15:34:43 -07:00
dwmac-socfpga.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sti.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-stm32.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sun8i.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sunxi.c net: stmicro: handle clk_prepare() failure during init 2021-05-13 17:33:18 +02:00
dwmac-visconti.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac4.h net: stmmac: Add hardware supported cross-timestamp 2021-03-24 15:12:36 -07:00
dwmac4_core.c net: stmmac: Clear receive all(RA) bit when promiscuous mode is off 2021-05-04 12:01:37 -07:00
dwmac4_descs.c net: stmmac: fix wrongly set buffer2 valid when sph unsupport 2021-02-26 15:17:11 -08:00
dwmac4_descs.h
dwmac4_dma.c net: stmmac: Do not enable RX FIFO overflow interrupts 2021-05-07 15:53:57 -07:00
dwmac4_dma.h net: stmmac: Add HW descriptor prefetch setting for DWMAC Core 5.20 onwards 2021-04-22 15:02:40 -07:00
dwmac4_lib.c net: stmmac: use interrupt mode INTM=1 for multi-MSI 2021-03-25 17:37:30 -07:00
dwmac5.c net: stmmac: enable MTL ECC Error Address Status Over-ride by default 2021-03-31 15:09:40 -07:00
dwmac5.h net: stmmac: enable MTL ECC Error Address Status Over-ride by default 2021-03-31 15:09:40 -07:00
dwmac100.h
dwmac100_core.c
dwmac100_dma.c
dwmac1000.h
dwmac1000_core.c
dwmac1000_dma.c net: stmmac: add per-queue TX & RX coalesce ethtool support 2021-03-17 14:36:24 -07:00
dwmac_dma.h net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwmac_lib.c net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxgmac2.h net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxgmac2_core.c
dwxgmac2_descs.c net: stmmac: fix wrongly set buffer2 valid when sph unsupport 2021-02-26 15:17:11 -08:00
dwxgmac2_dma.c net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxlgmac2.h
enh_desc.c net: stmmac: fix dma physical address of descriptor when display ring 2021-02-26 15:17:11 -08:00
hwif.c
hwif.h net: stmmac: Add callbacks for DWC xpcs Energy Efficient Ethernet 2021-05-17 15:53:58 -07:00
Kconfig net: stmmac: merge ARCH_SOCFPGA and ARCH_STRATIX10 2021-03-23 11:03:35 -05:00
Makefile net: stmmac: Add initial XDP support 2021-04-03 14:13:39 -07:00
mmc.h
mmc_core.c
norm_desc.c net: stmmac: fix dma physical address of descriptor when display ring 2021-02-26 15:17:11 -08:00
ring_mode.c
stmmac.h net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_ethtool.c net: stmmac: Add callbacks for DWC xpcs Energy Efficient Ethernet 2021-05-17 15:53:58 -07:00
stmmac_hwtstamp.c net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
stmmac_mdio.c net: stmmac: the XPCS obscures a potential "PHY not found" error 2021-05-28 15:21:13 -07:00
stmmac_pci.c net: stmmac: remove unnecessary pci_enable_msi() call 2021-04-01 15:49:23 -07:00
stmmac_pcs.h
stmmac_platform.c net: stmmac: platform: Delete a redundant condition branch 2021-05-10 14:50:00 -07:00
stmmac_platform.h of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
stmmac_ptp.c net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_ptp.h net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_selftests.c
stmmac_tc.c net: stmmac: Fix kernel panic due to NULL pointer dereference of fpe_cfg 2021-03-26 15:21:51 -07:00
stmmac_xdp.c net: stmmac: Add TX via XDP zero-copy socket 2021-04-13 15:06:51 -07:00
stmmac_xdp.h net: stmmac: Enable RX via AF_XDP zero-copy 2021-04-13 15:06:51 -07:00