]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: mdio: register PHYs via fwnode for PSE support 22019/head
authorCarlo Szelinsky <github@szelinsky.de>
Sat, 14 Feb 2026 15:11:59 +0000 (16:11 +0100)
committerRobert Marko <robimarko@gmail.com>
Thu, 19 Feb 2026 09:46:45 +0000 (10:46 +0100)
commita36ab12454e401bdc581e9f96458fa860ddfce73
tree1c3415f56e9838097aae85d19a5c6306c5b0b5a7
parent784ed3aeb6827f3cce0a6e53945b712f1a3d2573
realtek: mdio: register PHYs via fwnode for PSE support

Switch from auto-scan PHY discovery to explicit DT-based registration
using fwnode_mdiobus_register_phy(). This is the standard approach used
by of_mdiobus_register() and most MDIO drivers.

Auto-scan (phy_mask-based) registration does not attach DT fwnode data
to PHY devices, which means DT properties like "pses" are never parsed.
As a result, PSE controllers referenced from PHY nodes are not linked,
and ethtool PSE commands (--show-pse, --set-pse) do not work.

Store the device_node for each PHY found during DT parsing, suppress
auto-scan by setting phy_mask to ~0, and register each PHY explicitly
after devm_mdiobus_register(). This allows fwnode_find_pse_control() to
resolve PSE references and also establishes proper fw_devlink supplier
relationships.

Additionally this fixes a bug where the RTL8221B is limited to
1G and below due to missing DTS references.

Fixes: 4e00306 ("realtek: mdio: use bus auto registration")
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22019
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c