net: au1000: Bug fixes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest10 patches 2 repliesIn review
- v310 patches 6 repliesSuperseded
- v212 patches 6 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 11 patches | 9 replies | Superseded |
Changes in v4 from the cover letter
- Correct the PHY-disconnect commit message: the attachment path uses polling, so describe device/module reference leaks and the stale netdev attachment instead of surviving PHY interrupts. Document the existing repeated-reset hazard after register_netdev() failure.
- Narrow the TX critical sections to descriptor reservation and final publication. Copy and pad the packet outside the IRQ-disabled lock. Clear TX_T_DONE and advance tx_tail before dropping the lock when submission reclaims a completed descriptor, preventing double reclaim by a completion interrupt during the unlocked copy.
- Document that the SMSC PHY driver must bind before MAC attachment. The tested early-boot configuration uses CONFIG_SMSC_PHY=y; loading smsc.ko after genphy has attached does not replace that binding.
- Add the LSI/SEEQ OUI/model comment and document that the LAN83C183 PHY ID is shared with the L80227, which receives the same conservative resume delay. L80227 hardware remains untested.
- Add MAC-managed system-sleep callbacks. Explicitly stop and quiesce MAC RX/TX before stopping the PHY, including PHY states without a link-down callback. Restore the PHY before MAC initialization on resume. Handle inactive interfaces and keep failed resumes detached with the MAC reset; prevent IRQ-disable nesting on a subsequent retry.
- Move the link-down quiesce wait outside the device lock and use a sleepable wait with local interrupts restored. Retain existing atomic waits in the duplex-change and reset paths.
- Extend validation with TX/PM sanitizer harnesses, simultaneous TX/RX traffic, RX-stop descriptor observations, and device suspend/resume tests on MTX-1.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | net: au1000: recycle RX descriptors on allocation failuredrivers/ | +2 | 0 replies | |
| 2/10 | net: au1000: clear all-multicast mode when restoring hash filteringdrivers/ | +1 | 0 replies | |
| 3/10 | net: au1000: disconnect the PHY before freeing the MDIO busdrivers/ | +17 | 0 replies | |
| 4/10 | net: au1000: report MDIO transaction timeoutsdrivers/ | +15 | 0 replies | |
| 5/10 | net: au1000: serialize TX completion with packet submissiondrivers/ | +18 | 0 replies | |
| 6/10 | net: au1000: restore receive filtering before enabling RXdrivers/ | +20 | 0 replies | |
| 7/10 | net: au1000: restore RX buffer addresses when restarting the MACdrivers/ | +2 | 0 replies | |
| 8/10 | net: phy: smsc: wait for LAN83C183 power-down recoverydrivers/ drivers/ | +28 | 0 replies | |
| 9/10 | net: au1000: keep the MAC stopped until the PHY link is readydrivers/ | +124 | 0 replies | |
| 10/10 | net: au1000: reject frames larger than the TX bounce bufferdrivers/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH net v4 00/10] net: au1000: Bug fixes
This series fixes RX descriptor recycling, receive filtering, MDIO error reporting, TX ring synchronization, MAC/PHY lifecycle ordering, and TX bounce-buffer bounds in the Au1xxx Ethernet driver. It also adds the LAN83C183 PHY resume delay needed for MII clock recovery on the MTX-1.
Changes in v4:
- Correct the PHY-disconnect commit message: the attachment path uses polling, so describe device/module reference leaks and the stale netdev attachment instead of surviving PHY interrupts. Document the existing repeated-reset hazard after register_netdev() failure.
- Narrow the TX critical sections to descriptor reservation and final publication. Copy and pad the packet outside the IRQ-disabled lock. Clear TX_T_DONE and advance tx_tail before dropping the lock when submission reclaims a completed descriptor, preventing double reclaim by a completion interrupt during the unlocked copy.
- Document that the SMSC PHY driver must bind before MAC attachment. The tested early-boot configuration uses CONFIG_SMSC_PHY=y; loading smsc.ko after genphy has attached does not replace that binding.
- Add the LSI/SEEQ OUI/model comment and document that the LAN83C183 PHY ID is shared with the L80227, which receives the same conservative resume delay. L80227 hardware remains untested.
- Add MAC-managed system-sleep callbacks. Explicitly stop and quiesce MAC RX/TX before stopping the PHY, including PHY states without a link-down callback. Restore the PHY before MAC initialization on resume. Handle inactive interfaces and keep failed resumes detached with the MAC reset; prevent IRQ-disable nesting on a subsequent retry.
- Move the link-down quiesce wait outside the device lock and use a sleepable wait with local interrupts restored. Retain existing atomic waits in the duplex-change and reset paths.
- Extend validation with TX/PM sanitizer harnesses, simultaneous TX/RX traffic, RX-stop descriptor observations, and device suspend/resume tests on MTX-1.
Changes in v3:
- Drop the no-platform-data MAC-address patch: in-tree platform devices always supply platform data, so this is defensive hardening rather than a fix for an in-tree configuration.
- Drop the buffer descriptor free-list insertion patch: the affected list is only rebuilt during teardown and is never consumed again. The series now contains 10 patches instead of 12.
- Distinguish MDIO write-completion timeouts from pre-write busy timeouts in the diagnostic message.
- Clarify that the LAN83C183 recovery-delay patch and the following au1000 MAC/PHY sequencing patch are both required to fix MTX-1 reopen. Keep the PHY patch first so its delay is available to the MAC fix.
- Remove the unreachable initialization-error branch and PHY rollback from au1000_open(). Correct the commit message to distinguish the new synchronous PHY resume from the existing initialization-before- phy_start() ordering, and reconcile the reset comments.
- Expand the TX bounds-check commit message to cover plain AF_PACKET sendmsg(), PACKET_TX_RING, and oversized software-GSO segments.
- Rebuild the kernel and root filesystem and repeat MTX-1 regression testing after the review changes.
Changes in v2:
- Rebase onto net.
- Reset the MAC after PHY/MDIO teardown, and avoid MAC control accesses when its clock is already disabled.
- Use sleepable polling for MDIO write completion.
- Advance tx_tail when submission reclaims a completed TX descriptor, and consume transmitted skbs outside the lock with an IRQ-safe helper.
- Restore receive filtering before enabling RX, with the address-list and device locks held to keep the programmed filter consistent.
- Resume the PHY synchronously before MAC initialization, clear cached link state on open, and use acknowledged link/duplex state under the device lock. Place the LAN83C183 recovery-delay patch before this fix.
- Add a TX length check to prevent overflowing the DMA bounce buffer.
Testing:
The current series was rebuilt with Buildroot and tested on a Meshcube MTX-1, using the Alchemy PROM Ethernet-address lifetime fix as a separate boot prerequisite. That prerequisite is not included in this series. CONFIG_MIPS_AU1X00_ENET=y and CONFIG_SMSC_PHY=y were used, and boot logs confirmed attachment to the SMSC LAN83C183 driver.
The final run passed all 11 boot-smoke checks, including 15 down/up cycles across normal, promiscuous and all-multicast modes, opened/closed and never-opened removal/rebind, and connectivity recovery. Five additional device suspend/resume cycles passed: three with the interface up, one down, and one never opened after rebind. These used pm_test=devices with freeze and CONFIG_PM_DEBUG=y. The final ping received all 10 replies, and the kernel-log check reported no findings. Actual platform suspend-to-RAM was not tested.
An earlier run with the revised TX locking completed 20 seconds of bidirectional iperf3 traffic at approximately 14.4 Mbit/s TX and 40.9 Mbit/s RX. RX missed-frame errors increased by 10, while TX errors did not increase. There was no before/after overrun or IRQ-latency measurement; this test does not establish elimination of RX overruns.
The extracted TX functions passed 432 ring, copy, padding, IRQ-state and completion-interleaving cases under ASan/UBSan, plus busy and oversized-packet paths. Tests rejected the original locked copy and a variant omitting the early TX_T_DONE clear. A separate PM harness checked up/down and PHY-less cases, missing link-down callbacks, error cleanup and retry, and the unlocked link-down wait.
A logging-only kernel captured 44 RX descriptor snapshots across 11 stops during duplex changes under incoming traffic. Nine descriptors had advanced addresses with EN set and DN clear before stopping; all nine had DN set after the existing 10 ms wait. The reported state with an advanced address and DN clear after stopping was not reproduced. This finite MTX-1 test does not establish behavior for every silicon revision or link-loss timing; no RX reload change was made for that path.
Full AF_PACKET overflow triggers and hardware fault injection were not exercised.
Sashiko AI review identified issues addressed in the revisions. OpenAI Codex assisted source and datasheet analysis, code and changelog revisions, patch consolidation, test harnesses and regression testing.
Florian Fainelli (10):
net: au1000: recycle RX descriptors on allocation failure
net: au1000: clear all-multicast mode when restoring hash filtering
net: au1000: disconnect the PHY before freeing the MDIO bus
net: au1000: report MDIO transaction timeouts
net: au1000: serialize TX completion with packet submission
net: au1000: restore receive filtering before enabling RX
net: au1000: restore RX buffer addresses when restarting the MAC
net: phy: smsc: wait for LAN83C183 power-down recovery
net: au1000: keep the MAC stopped until the PHY link is ready
net: au1000: reject frames larger than the TX bounce buffer
drivers/net/ethernet/amd/au1000_eth.c | 248 +++++++++++++++++++++----- drivers/net/phy/Kconfig | 2 +- drivers/net/phy/smsc.c | 27 +++ 3 files changed, 233 insertions(+), 44 deletions(-)
base-commit: 145480b28ca82e9fae789427cc4569e596515a32
Signature · 1 line
2.53.0