Repository navigation
Conversation
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
approved these changes
Mar 24, 2026
Member
|
I'm a bit confused by these patch... in inband rate adaption should not be forced... the soc in theory should select the rate adaption internally based on the speed. For the reset it might be ok but i don't like the implementation at all... especially the 50 times loop and double cdr reset? my test were done with sfp usxgmii inband. |
This was referenced Mar 27, 2026
Member
|
@rchen14b any news for this? Can you give me some simple repro step? |
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 14, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
OpenWRT-fanboy
pushed a commit
to OpenWRT-fanboy/OpenW1700k
that referenced
this pull request
May 15, 2026
Add two kernel patches to fix USXGMII speed change handling in the Airoha PCS driver: Patch 620: Move USXGMII rate adaptation out of the forced-mode-only branch in airoha_pcs_link_up(). USXGMII uses in-band autonegotiation, so the rate adaptation registers were never updated on speed changes, causing PSE flooding that also broke 1G switch ports. Patch 621: Add global digital reset to AN7581 link_up for USXGMII and 10GBASE-R. When phylink renegotiates speed within the same interface mode, only link_up() is called. The existing TXPCS-only reset is insufficient - the RX data path must also be reinitialized via a full PCS/PMA digital reset sequence. Guard the global reset with a USXGMII PCS link status check to avoid resetting during initial boot when PHY firmware is still loading. A global PCS reset during PHY init can corrupt USXGMII autoneg state permanently, leaving the link stuck at 1G or dead. This also handles runtime PHY resets where the same vulnerable window exists.
Contributor
Author
|
This patch is no longer needed, the issue was caused by the RTL8261N phy, tested with rchen14b@0879b5b and rchen14b@d773be7 And no longer has any boot up brick issue or the speed neg issue. |
Member
|
Also the PCS driver got updated so maybe something got addressed also there.
Il Mar 2 Giu 2026, 05:09 Unkown Tiger ***@***.***> ha scritto:
… *rchen14b* left a comment (openwrt/openwrt#22536)
<#22536 (comment)>
This patch is no longer needed, the issue was caused by the RTL8261N phy,
tested with ***@***.***
<rchen14b@0879b5b>
and ***@***.***
<rchen14b@d773be7>
And no longer has any boot up brick issue or the speed neg issue.
—
Reply to this email directly, view it on GitHub
<#22536?email_source=notifications&email_token=AE2ZMQRXJ3QBKSFX4A6JXWD45ZAOTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJZHAZTMNZSGUZ2M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4598367253>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2ZMQSPJHC3XTQOTH47MC345ZAOTAVCNFSM6AAAAACWZTTOV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DKOJYGM3DOMRVGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix two bugs in the AN7581 PCS driver that break USXGMII data path
when phylink renegotiates speed.
Patch 620 — Rate adaptation not updated for USXGMII:
The rate adaptation register writes in
airoha_pcs_link_up()wereinside the forced-mode-only branch (
neg_mode != PHYLINK_PCS_NEG_INBAND).USXGMII always uses in-band autoneg, so these registers were never
updated on speed changes. This causes PSE flooding that also breaks
1G switch ports sharing the same Frame Engine.
Fix: move USXGMII rate adaptation out of the forced-mode guard.
Patch 621 — RX data path not reinitialized on speed change:
When phylink renegotiates speed within the same interface mode (e.g.
10G → 2.5G → 10G), only
link_up()is called — notpcs_config().The existing TXPCS-only reset in
an7581_pcs_phya_link_up()isinsufficient. The RX deserialization, FIFOs, and PMA digital logic
remain configured for the old speed, silently dropping all packets.
Fix: add a full PCS/PMA global digital reset (CDR re-lock + all reset
lines except REF_RST_N) for USXGMII and 10GBASE-R speed changes.
Guard the reset with a
needs_full_initflag set bypcs_config()after
bringup()runs. This skips the global reset on the firstlink_up()after boot/re-probe, whenbringup()already did a fullPCS/PMA init and the PHY firmware may still be loading. Firing a
global reset during PHY init can corrupt USXGMII autoneg state.
Both bugs are in the upstream
pcs-an7581.cdriver and affect anyAN7581 board with USXGMII PHYs (RTL8261N, AS21xxx).
Test results
"performing global digital reset" on replug
Test plan