]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: dsa: postpone probe due to deferred PHYs 23075/head
authorSven Eckelmann <sven@narfation.org>
Tue, 7 Apr 2026 07:14:25 +0000 (09:14 +0200)
committerRobert Marko <robimarko@gmail.com>
Mon, 27 Apr 2026 08:36:23 +0000 (10:36 +0200)
commitea3d646a08524b1cf4560ae351845a125a7d22c6
tree018e894fb76ba0ebffaf09248e81e9f7326cb04e
parent6a237334372e0c80762046c1efb0c91a76250387
realtek: dsa: postpone probe due to deferred PHYs

PHY drivers might need access to NVMEM or the filesystem to load
calibration/initialization data. The driver will then return -EPROBE_DEFER
to signal to the device core that the probe should be retried multiple
times again in the 10s driver_deferred_probe_timeout.

But when the switch driver calls dsa_register_switch(), it needs to connect
the PHYs directly. As result, all PHYs without an driver will automatically
get the default driver (either `genphy_c45_driver` or `genphy_driver`)
assigned and initialized. But for PHYs with the additional initialization
data from NVMEM/fs, this will usually result in not working PHYs.

Since there are Realtek based boards with RTL826x PHYs and the new driver
loads the initialization/patch values from rootfs, it is necessary to check
in the beginning of the probe function whether the PHYs are ready and the
probing can continue.

If some driver is still without driver after the deferred probe period
ended, the loading will just continue and the generic PHY drivers will
still be used.

Closes: #22811
Co-authored-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Co-authored-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/23075
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/common.c