Repository navigation
kernel: rtl8261n: clear PMA_CTRL LPOWER bit on Realtek SoCs - #23386
carlosz1986 wants to merge 2 commits into
Conversation
|
I'm totally lost regarding all these RTL826x discussion. But PHY does not depend on MACH. So this is wrong (and the last patch too). To start somewhere: Unconditionally clear the bit in config_init(). That should be needed on all architectures. @jonasjelonek any issues you came around on SerDes side regarding the low power state? |
I change the PR to draft, what it actually is ... |
|
Ok had a look around. The old patch is a mess. First: The driver should simply use genphy_c45_pma_resume(). See https://elixir.bootlin.com/linux/v6.18.1/source/drivers/net/phy/phy-c45.c#L52 That is a must-have and the part from the old patch can be reverted. Second: If low power mode "aka genphy_c45_pma_suspend() or rtkphy_c45_suspend()" is not desired on Realtek platform we should work around that with a devicetree quirk. Maybe something like "realtek,disable-pma-low-power" for the time being. |
|
Thx for fast help @plappermaul , I appreciate it!
So this would replace my part with something like: The dts config like "realtek,disable-pma-low-power" would only make sense if this change would cause issues on other devices, wouldn't it? |
|
Regarding resume: rtk_phylib_c45_power_normal() and its consumer is basically genphy_c45_pma_resume(). So you can drop these functions completely and just link genphy_c45_pma_resume() in the driver table. Regarding disabling of suspend() something like this is needed: Add the property to the phy in the devicetree and suspend should be deactivated. |
b3424df to
a8c563d
Compare
Actually no, when I had to deal with this PHY this issue didn't came up and the SerDes side was mostly working fine. And no apparent issues with other PHYs. |
openwrt-ai
left a comment
There was a problem hiding this comment.
No issues found.
To address review feedback, force-push fixes to this branch.
Don't close and open a new PR — that loses the review history
and the bot starts from scratch.
Generated by Claude Code
|
Looking at mirror/dd-wrt@777419c I anticipate we have some complexer issues on all devices. So please adapt as follows:
Thanks in advance. |
Replace rtkphy_c45_resume() with a direct reference to genphy_c45_pma_resume() in the driver ops table. The vendor wrapper rtk_phylib_c45_power_normal() performs a single MMD write that is bit-identical to the standard kernel helper; drop both the wrapper and the rtkphy_c45_resume() function it served. Resume is the safe direction here (clears MDIO_CTRL1_LPOWER) and can run on all platforms. Commit b77fa45 ("kernel: fix rtl8261n driver for realtek") previously made resume a no-op on CONFIG_MACH_REALTEK_RTL, assuming the bootloader had taken the PMA out of low-power mode itself, which is not true on every Realtek board (e.g. Hasivo S1300WP-8XGT-4S+). The suspend path is intentionally left untouched here; a follow-up patch addresses the broader question of when the PMA-low-power transition is safe to perform. Signed-off-by: Carlo Szelinsky <[email protected]>
a8c563d to
f140bff
Compare
I have to thank you :-) It was super helpful! I pushed the required changes... |
31b4adc to
e20c692
Compare
PMA-low-power suspend on the rtl8261n family has been reported to leave the PHY unrecoverable on platforms outside the Realtek world as well, not just on Realtek SoCs. The previous OpenWrt mitigation (commit b77fa45 "kernel: fix rtl8261n driver for realtek") only gated the suspend on CONFIG_MACH_REALTEK_RTL, which leaves every other platform exposed. Reverse the default: skip the PMA-low-power suspend unless the PHY node carries the new boolean property "realtek,enable-pma-low-power". Emit a per-PHY warning at probe when the property is absent, so board maintainers see the prompt to verify suspend/resume on their hardware and opt in. Once verified, a board sets the property on its PHY nodes; the suspend callback then runs via the standard genphy_c45_pma_suspend() helper (bit-identical to the dropped vendor wrapper). The previous #ifndef CONFIG_MACH_REALTEK_RTL guard and the rtk_phylib_c45_power_low() vendor wrapper are removed. The new flag is cached in struct rtk_phy_priv alongside the existing pnswap-* flags, keeping the DT-property read out of the per-suspend hot path. Signed-off-by: Carlo Szelinsky <[email protected]>
e20c692 to
60e78f5
Compare
|
I close this one, because the change is already in the driver PR itself... |
While working on the Hasivo S1300WP-8XGT-4S, I figured out that the auto-negotiate never starts...
I could get it running by clearing bit 11 (PMA_CTRL) ...
Her is a working branch, for the device - but everything is still pretty hacky and early stage.
main...carlosz1986:openwrt:hasivo_S1300WP-8XGT-4S-plus_clean
And the discussion is here:
https://forum.openwrt.org/t/hasivo-s1300wp-8xgt-4s/233033/62
I would appreciate feedback from the experts :-)
cheers