From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796251806; b=kqmufrzBMtZqXDm3tI1PG/Awsi6LsPH84633yJSz3PwXin3KiiOETOoO1HnB2A/Nreqk XmR/gTYE5GmH6297tosxs38HipHITIudqaVFSLMsh5tOD2f508US959oOAOl1m/TUA2+a X08bJp6QIoLRH1vMlpMCcP2awm7kcG6di6KCf2jOFQxQfYNuvx2hm5CP7YikQgq3aldo5 LmbFp9dAbhiUYmfvypx4WbC09tOWNvHK4D/o3K0Tul5tkJ/+iORXk98vAm8SAh7TP8dRz w/C1fxRk+5hTXWodqCoUjmYSgdhWMyJXLPmKLi0AW80wlqKt/S+ffoRH6VfryDyeDSg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796251806; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=raEAEr4xEeeMssF4r8OlTG0TwW7i3h/tKc9xUQwdiXA=; b=EINRzkEp/zAEJda979e1RMOF6XpXC/5yiPDAouqtrBi6eXDrOTkQVtPiHObXyMsSgOEM Nqw64kKEhFVMSF+wGoZLuvl1aYwwye+ZztihbdIEOXey2JWxNj4OLxfeI4yGcDG8ssL0n vnibGmVGYcQjCeiXOLW/B6NLW6rB50a3S1OTxsS34yhg3YJBzaol5yKORkMpFc/7YA3eD W7n31TAcMYM1sMNB/UFAvn2rwe4hSKAcb2q4/r6/xJPQMuhGniI8JCB99RVvdzWm31Ja8 lDnG4eE4G82gjcnLlgnpPfbDuEWQ9UcOpkUuVCPlCIXY+ZIEUuSL+/ZsiXhXOM+cGCQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=C9olKQBf; arc=none smtp.remote-ip=74.125.82.47 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EA36606A32C for ; Wed, 2 Dec 2026 22:50:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0EA36606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=C9olKQBf Received: by mail-dl1-f47.google.com with SMTP id a92af1059eb24-1b546061d58so7168161c88.1 for ; Wed, 02 Dec 2026 14:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796251805; x=1796856605; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=raEAEr4xEeeMssF4r8OlTG0TwW7i3h/tKc9xUQwdiXA=; b=C9olKQBfcJ6mzZvu3m5C8+CP6sUwzSIdFa2BLn0rri6VSbBo+lE6bk4Vm15wVBoxSx FdC5nM/959UrnJnrLBM0LdfrgI8zsuBniFmbsuNI+1hPanPlNxcU/f9hbHF5kpp0xtwX cUFthxVSJUt/W0IXnNr+2JyyY33Ki3pKTXlFHKFdzqQyP1ze5eklbQ2uZBsOax9na6MJ gIjqd3AFBe8cAxnhMe/QO8T2YWEKjIReJBJR/cPPCytdi+nPQx2VLNOFQQaMgN0skUva anHi24fgyzOdeynvc1lm2GFKFDdWBur+/VPSV4phGAfQFktw3Axav2pAtozgBbSoUPBg ixKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796251805; x=1796856605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=raEAEr4xEeeMssF4r8OlTG0TwW7i3h/tKc9xUQwdiXA=; b=CLhBXQgfdCvrahHAWfGwBnWLBS/dOWOkIG99xtKjH/2UYw2H3mFb3D6bNay11BUr8V zSBGXU0s3qcH+5qW8WqX+Pfgz2QOrNLm7Ozw0Pm/VUHcexWT6/qtscgZ2zLMJDK8NoFO vkIEHP4GtlWPNcTfqM3o0qNPYLqnQnIy6Ho7iUe//I02pnSCLymhxrsLq4TGUsYR/IcX /BDUx0SbZ8+7pWk2DT6cMfT+3z1ktooaD0B/AtKtjzRvkF5lMfO9UqAoQ+KLWD56qnkC W1UiT2MZBeh11KiH7ViSoR5Vn3gWS/es1AkEweLXjzeDbqXqHxZk/HcCM1B5C6xs5ZLs iL6w== X-Gm-Message-State: APuU4Z/pGERUocV1fwG3P04HjtPLjyWaDTwH0rELZZIXP6Atk07d8dYS JT45kyQR9POi2otLEXwdV3PiAuTpdpb1//cuEyxBzI/hULwSPi0juPH8Z0J89g== X-Gm-Gg: AZFdTZfRdYii+FxJvj0aR50B/72P5Df1Kjlz+GkBJXEVZJPS6Ftjnaeay/ENPxJctYD bXwU0p2kUVb+bgufNdsogPZl49sUW5PnrfZPTJwVhkUP4mtglh6deYWtUbS+TfDOHC3wyj9dTq0 UGz8wXhRkSphT5i1szYe3lu/BXcaSAacQ5kdQoxJocY5Jx56PFfiI1qucBbs44764xWtSD7Ezld pfmWPVZRxCPOn6MvJxwsGmBE1ejptw3fCtKuOa9eCG98T807ffQVmnhxxsZxIT5clN25Xc+akya 5uejlY1zQhuK/WuWFoeCCPAT7dS0fvnvoK+Vn0zMYmjlWUNWu+ddJ0mIKVmTqWpBbN/gGSvEuql 2laAWDgf0WOCIw/INA6on/zJHmwrTvpQpQuq56pd/aKF5yR5qDUtg9MildSjHCI4dqsqiLGFhg4 FIRtgmo4ayvobfWHJsM/diyplphz3p6Eh8/av8xytnrIE+Yp0ULprwhfywlXnnmph2uF4bnl67k mfDjs5c851jIVeOqvM/aVkjKA/Sba2/f7d39tSCV4IGNEFAy9Xb8ZgzvvljHmNyNGMfE6QtmT0x +MajuHMJLcWqPtElRJRbDqyCc4w/oTJ9VZl6dGtSK+7Xf67OAg== X-Received: by 2002:a05:7022:2649:b0:194:9e7a:3ba2 with SMTP id a92af1059eb24-1b5567f682amr39746812c88.2.1796251805048; Wed, 02 Dec 2026 14:50:05 -0800 (PST) Received: from eldorado ([2600:8802:b00:1f88:d294:66ff:fe95:a98e]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b55684c85fsm151770048c88.14.2026.12.02.14.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 14:50:04 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Jijie Shao , Simon Horman , Runyu Xiao , David Yang , Herbert Valerio Riedel , Danny Kukawka , Mugunthan V N , Sebastian Hesselbarth , linux-kernel@vger.kernel.org (open list), Manuel Lauss Subject: [PATCH net v5 00/10] net: au1000: Bug fixes Date: Wed, 2 Dec 2026 14:49:47 -0800 Message-ID: <20261202224957.3043478-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 v5: - Add Simon Horman's Reviewed-by to patches 1-8 and 10. Patch 9 has changed and does not carry his tag. - Mark every PHY registered on the MAC's MDIO bus as MAC-managed for system sleep, including unattached aliases. Prevent independent bus PM from powering down the physical PHY before the MAC stops or accessing MDIO after its clock is gated. Manage the attached PHY once rather than issuing duplicate power/reset operations through aliases. - Reinitialize and resume the attached PHY after system sleep even when the interface is down, then reset and clock-gate the MAC again. Leave the IRQ and PHY state machine stopped for an inactive interface. - Allow ifdown/ifup recovery after a failed system resume: skip phy_stop() for an already halted PHY and restore netdev presence after freeing the IRQ. Initialize the PHY on open so the next ifup retries both initialization and resume without requiring driver rebind. - Extend the PM reproducer with alias ordering, lost PHY configuration, and initialization/resume error recovery. Rebuild and repeat MTX-1 boot, Ethernet lifecycle and device-PM regression testing. 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. The regression script passed five device suspend/resume cycles: 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. A sixth device-PM cycle with the interface down confirmed that the MAC enable register remained zero after resume; bringing the interface up again restored connectivity. 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. For v5, seven PM test groups passed with the actual driver functions under ASan/UBSan. The previous series failed the alias suspend/resume, lost configuration, and both initialization/resume error recovery cases. On the live MTX-1, only address 31 bound to the SMSC driver; the bound-alias failure and transient PHY errors were exercised in the host harness. 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 | 264 +++++++++++++++++++++----- drivers/net/phy/Kconfig | 2 +- drivers/net/phy/smsc.c | 27 +++ 3 files changed, 248 insertions(+), 45 deletions(-) base-commit: 145480b28ca82e9fae789427cc4569e596515a32 -- 2.53.0