Skip to content

kernel: backport MT7530 broken-EEE fix from upstream (6.12-adapted) - #25206

Open
work423 wants to merge 1 commit into
openwrt:openwrt-25.12from
work423:eee-mt7530-2512
Open

work423 wants to merge 1 commit into
openwrt:openwrt-25.12from
work423:eee-mt7530-2512

Conversation

@work423

@work423 work423 commented Sep 15, 2026

Copy link
Copy Markdown

Backport of the upstream MT7530 broken-EEE fix to the 25.12 branch (kernel 6.12), requested in #25058.

The MT7530 internal GE PHY has broken EEE: on a 2-pair cable where both ends advertise gigabit, the port loops instead of falling back to 100 Mbps, so no link and no DHCP. This is the regression behind #24752 and #15348 - users of official 25.12.x on MT7621/MT7530 hit it on every boot.

Upstream commit ccbe7540e4aa ("net: phy: mediatek-ge: disable EEE on the MT7530 PHY", in netdev/net.git, bound for v7.3) fixes it in the PHY driver; the -stable process is already distributing it (queued for 7.2-stable as 4fe7399eb52b, 6.12.x expected to follow), but the kernel bump plus a 25.12 point release still takes a while. This PR brings the fix to 25.12 users now.

Adaptation for 6.12 (more than a patch refresh, hence a separate PR rather than the usual backport-after-main): 6.12 has neither phy_disable_eee() nor the current EEE advertisement model, so the durable disable sets the equivalent state by hand - clears advertising_eee and eee_cfg.eee_enabled / tx_lpi_enabled and fills eee_broken_modes with all raw MDIO_AN_EEE_ADV bits, so neither phylib nor ethtool can re-advertise EEE. The probe()/config_init() placement is unchanged: probe() kills the advertisement before anything negotiates, config_init() is what phy_init_hw() replays after resets and runs after of_set_phy_eee_broken(), so the state survives. Once 6.12.x carries the upstream backport, this patch can be dropped at the next kernel bump.

Tested on ASUS RT-AX53U (MT7621, same PHY) on the equivalent main/6.18 backport (#25058): single clean 100 Mbps WAN link + DHCP lease over a 2-pair cable, where unpatched kernels loop.

@openwrt openwrt Bot added kernel pull request/issue with Linux kernel related changes not following guidelines Pull request does not follow formatting guidelines release/25.12 pull request/issue targeted (also) for OpenWrt 24.10 release labels Sep 15, 2026
@openwrt

openwrt Bot commented Sep 15, 2026

Copy link
Copy Markdown

Formality Check: Suggestions Available

We checked this pull request against the contribution guidelines. Here is what needs your attention:

⚠️ STYLISTIC WARNINGS & SUGGESTIONS

Commit 39f307d:

  • ⚠️ Could not fetch upstream commit ccbe754 from GitHub API (HTTP 422)

Something broken? Consider reporting an issue.
Running version 059e3de deployed on 2026-09-09 11:53:18 CEST

@openwrt openwrt Bot removed the not following guidelines Pull request does not follow formatting guidelines label Sep 15, 2026

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 84dcbb4 "kernel: backport MT7530 broken-EEE fix from upstream (6.12-adapted)" — the entire message body is indented two spaces, including Signed-off-by: and the cherry-pick trailer, so git does not parse them as trailers and the commit has no recognised SoB. Unindent the body to column 0.
  • 84dcbb4(cherry picked from commit ccbe7540e4aad0d1c3acc249697350b93ccb8025) names a Linux commit, not an OpenWrt one, and the main-branch counterpart (#25058) is still open, so nothing was cherry-picked here. Drop the trailer; the upstream reference belongs in the patch header/backport note only.

Generated by Claude Code

@@ -0,0 +1,116 @@
From 687c573f0e000000000000000000000000000000 Mon Sep 17 00:00:00 2001

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a commit hash — it is the post-image blob hash from the index 97d845c..687c573 line below, zero-padded to 40 chars (the pre-image 97d845c does check out against the OpenWrt-patched 6.12 tree). Use the upstream commit named in the backport note so the patch stays traceable and can be dropped at the kernel bump.

Suggested change
From 687c573f0e000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From ccbe7540e4aad0d1c3acc249697350b93ccb8025 Mon Sep 17 00:00:00 2001

Generated by Claude Code

Comment on lines +99 to +102
+ linkmode_zero(phydev->advertising_eee);
+ phydev->eee_cfg.eee_enabled = false;
+ phydev->eee_cfg.tx_lpi_enabled = false;
+ phydev->eee_broken_modes = ~0U;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 6.12 the flag phylib actually tests on the advertisement path is the standalone phydev->eee_enabled, not eee_cfg.eee_enabled — see genphy_c45_an_config_eee_aneg() at phy-c45.c:945, while eee_cfg only feeds ethtool reporting and enable_tx_lpi. Adding phydev->eee_enabled = false; here would make the hand-rolled state match what phy_disable_eee() sets upstream; as written only eee_broken_modes is load-bearing, so the "neither phylib nor ethtool can re-advertise EEE" claim rests on that single line. (Adding a line means the hunk header and diffstat need refreshing — make target/linux/refresh.)


Generated by Claude Code

Upstream commit ccbe7540e4aa (bound for v7.3) disables broken EEE on
the MT7530 internal GE PHY. Adapted for 6.12, which has no
phy_disable_eee(): the durable disable sets the equivalent state by
hand (clears advertising_eee, phydev->eee_enabled and the eee_cfg
flags, and fills eee_broken_modes). Fixes the WAN gigabit-fallback
loop on MT7621 boards with 2-pair cables (openwrt#24752).

Signed-off-by: Vladislav Karmanov <[email protected]>
(cherry picked from commit ccbe7540e4aad0d1c3acc249697350b93ccb8025)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel pull request/issue with Linux kernel related changes release/25.12 pull request/issue targeted (also) for OpenWrt 24.10 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants