kernel: net: phy: realtek: replace hack with proper fix
authorDaniel Golle <daniel@makrotopia.org>
Sat, 3 Jan 2026 18:43:33 +0000 (18:43 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 7 Jan 2026 01:30:26 +0000 (01:30 +0000)
commit5652b98952c4da76060bbe051b521da3dba7164f
tree412ac882d3dbb1a813e9cff991a412918b7eae54
parente06c4125fddae7d1810772b2aa6b40f2267c2cea
kernel: net: phy: realtek: replace hack with proper fix

RealTek's 2.5G PHYs suffer from an up to now inexplicable problem which
results in the SerDes mode not being properly setup and disabling
in-band AN leading to a timeout waiting for a busy-bit to clear. Up to
now there has been a crude work-around: resetting the PHY and trying
another time.

The cause has now been found as a wrong access to register PHYCR1 on
MDIO_MMD_VEND1 instead of MDIO_MMD_VEND2 when setting up ALDPS as well
as disabling the MDIO broadcast address 0.

In order to access MDIO_MMD_VEND2 on Clause-22-only busses a custom
.read_mmd and .write_mmd ops are implemented, mapping MDIO_MMD_VEND2 to
paged access as this is required.

Also, as ALDPS by design disables the SerDes PCS of the PHY in case the
link has been down for a while, move enabling ALDPS to the end of the
config_init function to not face problems when configuring the interface
mode and in-band AN.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic/pending-6.12/715-net-phy-export-mmd_phy_-functions.patch [new file with mode: 0644]
target/linux/generic/pending-6.12/720-00-net-phy-realtek-use-paged-access-for-MDIO_MMD_VEND2-.patch [new file with mode: 0644]
target/linux/generic/pending-6.12/720-01-net-phy-realtek-use-genphy_soft_reset-for-2.5G-PHYs.patch
target/linux/generic/pending-6.12/720-02-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch
target/linux/generic/pending-6.12/720-03-net-phy-realtek-make-sure-paged-read-is-protected-by.patch
target/linux/generic/pending-6.12/720-04-net-phy-realtek-setup-aldps.patch
target/linux/generic/pending-6.12/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch
target/linux/generic/pending-6.12/720-07-net-phy-realtek-mark-existing-MMDs-as-present.patch
target/linux/generic/pending-6.12/720-08-net-phy-realtek-work-around-broken-serdes.patch [deleted file]
target/linux/generic/pending-6.12/720-09-net-phy-realtek-disable-MDIO-broadcast.patch