linux-uconsole/drivers/net/phy
Florian Fainelli 1c5f764382 net: phy: Check harder for errors in get_phy_id()
[ Upstream commit b2ffc75e2e ]

Commit 02a6efcab6 ("net: phy: allow scanning busses with missing
phys") added a special condition to return -ENODEV in case -ENODEV or
-EIO was returned from the first read of the MII_PHYSID1 register.

In case the MDIO bus data line pull-up is not strong enough, the MDIO
bus controller will not flag this as a read error. This can happen when
a pluggable daughter card is not connected and weak internal pull-ups
are used (since that is the only option, otherwise the pins are
floating).

The second read of MII_PHYSID2 will be correctly flagged an error
though, but now we will return -EIO which will be treated as a hard
error, thus preventing MDIO bus scanning loops to continue succesfully.

Apply the same logic to both register reads, thus allowing the scanning
logic to proceed.

Fixes: 02a6efcab6 ("net: phy: allow scanning busses with missing phys")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 23:17:06 -04:00
..
amd.c
aquantia.c
at803x.c
ax88796b.c net: phy: rename Asix Electronics PHY driver 2019-07-14 08:11:08 +02:00
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
bcm7xxx.c net: phy: bcm7xxx: define soft_reset for 40nm EPHY 2019-11-10 11:27:52 +01:00
bcm63xx.c
bcm87xx.c
broadcom.c
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83640.c dp83640: reverse arguments to list_add_tail 2020-05-14 07:57:17 +02:00
dp83640_reg.h
dp83822.c
dp83848.c
dp83867.c net: phy: dp83867: enable robust auto-mdix 2019-12-31 16:35:27 +01:00
et1011c.c
fixed_phy.c net: phy: fixed_phy: Fix fixed_phy not checking GPIO 2020-01-27 14:50:20 +01:00
icplus.c
intel-xway.c
Kconfig net: phy: rename Asix Electronics PHY driver 2019-07-14 08:11:08 +02:00
lxt.c
Makefile net: phy: rename Asix Electronics PHY driver 2019-07-14 08:11:08 +02:00
marvell.c net: phy: marvell: Fix buffer overrun with stats counters 2019-05-05 14:42:38 +02:00
marvell10g.c net: phy: marvell10g: report if the PHY fails to boot firmware 2019-06-04 08:02:32 +02:00
mdio-bcm-iproc.c net: phy: restore mdio regs in the iproc mdio driver 2020-03-05 16:42:16 +01:00
mdio-bcm-unimac.c net: phy: mdio-bcm-unimac: mark PM functions as __maybe_unused 2019-11-20 18:47:53 +01:00
mdio-bitbang.c
mdio-boardinfo.c
mdio-boardinfo.h
mdio-cavium.c
mdio-cavium.h
mdio-gpio.c
mdio-hisi-femac.c
mdio-i2c.c
mdio-i2c.h
mdio-moxart.c
mdio-mscc-miim.c
mdio-mux-bcm-iproc.c net: phy: mdio-mux-bcm-iproc: check clk_prepare_enable() return value 2020-04-02 15:28:13 +02:00
mdio-mux-gpio.c
mdio-mux-mmioreg.c
mdio-mux.c
mdio-octeon.c
mdio-sun4i.c
mdio-thunder.c
mdio-xgene.c
mdio-xgene.h
mdio_bus.c mdio_bus: Fix PTR_ERR() usage after initialization to constant 2020-01-27 14:50:24 +01:00
mdio_device.c
meson-gxl.c net: phy: meson-gxl: fix interrupt support 2019-04-03 06:26:17 +02:00
micrel.c net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers 2020-04-13 10:45:08 +02:00
microchip.c
microchip_t1.c
mscc.c net: phy: mscc: read 'vsc8531, edge-slowdown' as an u32 2019-11-20 18:45:53 +01:00
national.c net/phy: fix DP83865 10 Mbps HDX loopback disable function 2019-10-05 13:09:27 +02:00
phy-c45.c net: phy: consider latched link-down status in polling mode 2019-04-05 22:33:10 +02:00
phy-core.c
phy.c net: phy: fix aneg restart in phy_ethtool_set_eee 2020-05-20 08:18:35 +02:00
phy_device.c net: phy: Check harder for errors in get_phy_id() 2020-06-30 23:17:06 -04:00
phy_led_triggers.c net: phy: phy_led_triggers: Fix a possible null-pointer dereference in phy_led_trigger_change_speed() 2019-08-29 08:28:36 +02:00
phylink.c net: phylink: Fix flow control resolution 2019-09-19 09:09:30 +02:00
qsemi.c
realtek.c
rockchip.c
sfp-bus.c net: sfp: do not probe SFP module before we're attached 2019-02-27 10:08:58 +01:00
sfp.c net: phy: sfp: hwmon: Fix scaling of RX power 2019-07-28 08:29:24 +02:00
sfp.h net: sfp: do not probe SFP module before we're attached 2019-02-27 10:08:58 +01:00
smsc.c
spi_ks8995.c spi: Micrel eth switch: declare missing of table 2019-05-16 19:41:25 +02:00
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c net: phy: xgmiitorgmii: Support generic PHY status read 2019-02-23 09:07:25 +01:00