Article View: linux.kernel.netdev
Article #24786[PATCH net v2 0/2] net: ethernet: ti: cpsw_ale: fix lost ALE entries
From: Manuel Janocha via B4 Relay
Date: Mon, 30 Nov 2026 20:34
Date: Mon, 30 Nov 2026 20:34
78 lines
14226 bytes
14226 bytes
On AM62x/AM625 with both CPSW3G ports in dual EMAC mode and VLAN
interfaces on top, reception of untagged frames on a port can stop. The
port VLAN entry at ALE index 0 had been overwritten by an IPv6
multicast entry (33:33:...). Only link down/up recovers the port.
Two independent causes were found, one patch each:
1. The ALE table is accessed through an index register and three data
registers. The read-modify-write sequences in cpsw_ale.c run
concurrently from different contexts, for example ndo_set_rx_mode()
of one port against VLAN add/kill on the other, without any lock.
Entries get lost or mixed. Patch 1 adds a lock to struct cpsw_ale.
2. Even with the lock held, a table read occasionally returns the
content of another index or all zeros. Reading the data words again
without rewriting the index stays wrong, rewriting the index and
reading again returns the right entry. Either of two consecutive
reads can be the bad one. If the VLAN entry reads as free, its
index is handed out as a free slot and overwritten. Patch 2 reads
every entry twice, rewriting the index each time, and retries until
both reads match.
The AM62x TRM (SPRUIV7) says that after a write to ALE_TBLCTL any ALE
register access is stalled until the table operation completes, so the
access sequence in the driver is as documented. TI lists a matching
unresolved issue for the J7 CPSW in its public tracker as EXT_EP-12856
(workaround: trigger the read twice); AM62x is not listed there.
Measured on a PHYTEC phyCORE-AM62x (CPSW3G, two ports in dual EMAC
mode, VLAN sub-interfaces). Stress: multicast joins and leaves on both
ports plus VLAN add/remove, 120 seconds per run.
- net v7.4-rc3, patch 1 only: 2 of 19 runs failed
- net v7.4-rc3, both patches: 60 runs passed, lockdep enabled, no
warnings
- TI/PHYTEC 6.18 vendor kernel, patch 1 only: 1 of 29 runs failed
- same kernel, patch 2 only (no lock): failed in the first run, with
torn entries
- same kernel, both patches: 400 runs passed; mismatching reads were
caught and corrected by the retry (seen at index 0 and index 64)
- a 6.6 based kernel without the patches also fails (run 8); it does
not have the commit named in patch 1, which points to cause 2
Test coverage: both patches together were run-tested on net v7.4-rc3
and on the 6.18 vendor kernel, which has the same cpsw_ale.c table
access code. The legacy cpsw, cpsw_new and netcp users of the ALE are
compile-tested only.
Signed-off-by: Manuel Janocha <manuel.janocha@amperfied.com>
---
Changes in v2:
- Patch 1: use spin_lock_irqsave() instead of spin_lock_bh(): netcp
calls cpsw_ale_add_vlan()/cpsw_ale_del_vlan() with interrupts
disabled
- Patch 1: also lock the read-modify-write in cpsw_ale_control_set()
- Patch 1: correct the changelog: affected drivers (cpsw/cpsw_new are
already serialized by their rx_mode work item), accessors are the
_relaxed variants; test results updated
- New patch 2: verify ALE table reads (hardware read glitch seen with
the lock in place)
- Link to v1: https://patch.msgid.link/20261127-cpsw-ale-lock-v1-1-a72772d9a5ae@amperfied.com
---
Manuel Janocha (2):
net: ethernet: ti: cpsw_ale: serialize ALE table accesses
net: ethernet: ti: cpsw_ale: verify ALE table reads
drivers/net/ethernet/ti/cpsw_ale.c | 117 ++++++++++++++++++++++++++++++++-----
drivers/net/ethernet/ti/cpsw_ale.h | 2 +
2 files changed, 106 insertions(+), 13 deletions(-)
---
base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f
change-id: 20261126-cpsw-ale-lock-cc05d5bea7a0
Best regards,
--
Manuel Janocha <manuel.janocha@amperfied.com>
Technical Details
Message-ID:
<20261130-cpsw-ale-lock-v2-0-c7a59d2178bb@amperfied.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374456-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374456-linux-kernel-netdev=dewy.ru From: devnull+manuel.janocha.amperfied.com@kernel.org (Manuel Janocha via B4 Relay) Newsgroups: linux.kernel.netdev Subject: [PATCH net v2 0/2] net: ethernet: ti: cpsw_ale: fix lost ALE entries Date: Mon, 30 Nov 2026 20:34:45 +0000 Organization: Usenet Network Message-ID: <20261130-cpsw-ale-lock-v2-0-c7a59d2178bb@amperfied.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1531867"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:wB6r0zeBnyplZmtht9SXgDOY2+k= sha256:MR7AChPHHX2CBBAaI1fHGhreEdG5ThmwdrCKBACKktM= sha1:WRN4+P95X0KvR2s/yadIYLzldBw= sha256:FwJgBMLVUWD/nCXJQT13YTPE5PrJdd7DVzjiCClcpEI= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 3975E126006; Mon, 30 Nov 2026 23:35:22 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5LPGKjhEfqEn; Mon, 30 Nov 2026 23:35:18 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374456-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 8B89E126009; Mon, 30 Nov 2026 23:35:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id ACDEA2CAB0; Mon, 30 Nov 2026 20:35:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796070900; b=fqP+QX1mOXIYzT34AIz9nG0PmifFh52rZmtsYLodrWpFLHpXQlJ9pxcqeOpF6IMlGMXC +80OehOdBNzLvK0vuGAaVx/qlYpIP7Tb+SaqMTXhENt+agU36znKdoC0E6+VVdPwqMM28 l4AZL8mf560lZE0JgYaQsC7BPuqbTXzic3RBxb4dch1IAW7tuWoZthrUup3UoDrt5Cm2Y WnQcz+sMI1kum/qeWwTysJqR7Ri1/tLvR0CuAYynY1JjEByPOBLctB/yH9GWS8oRz4+mD RjuHCSaVJSFDmPNp0HjltHhZTOXeUoOlNrbLeHfCqSfASKcp5BgCq1KcnOx9EcJufJw== X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796070900; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Subject: Date:Message-Id:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=ZAwVbk66DtaDtoBZxGbT/v6ygXGYmM6kWH1NOZk/w44=; b=jayzI5FbmdEPF1IohDX+IDE2LTkASAdCXBu6X0OfcGhHieShTivH1NbaTOZvUQOzGaSM 7AyLY4FsF8mnU/ax6Pf1B2kCud0BTcbRJIuIUzwaAfy4Vcwbgx4NZ6q5/pyi4XAdrCFKQ yrxoSvkcLfrN+hkC818stcIm+sGtqBtim8Ly0CMeNpkkIvjh/hEnOw6EweupidqUzfIVs OLxHUmM3GOdnXohpcgcECXCPJYOhrenVzJgl26dpv5/OWmjlJBxwX5DG887fHwHvS9vQG udVPXvRKnFZzUGVbLHU6vHOH40iRsaXgLkW3B03C726arzQr/IujzLgFziLb+eu/J4g== X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FA5WZBuq; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90969606A68A; Mon, 30 Nov 2026 20:35:00 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FA5WZBuq X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796070894; b=0g3aXGV3SBAHx7OVTBX6en7jU6E7bdSPjRhSvIhk0ff4h5O7PF/RGE5b+Jr33fJolKSi istQQGkkwBCG6s0IgDrK0bYg75fvtSCd2Wdx/LqFM1jcSM2K7iGe8nvPBQNBbQthchgN5 W8wmEJzx3J0/XIsraZpVrUWChLyGVMaiTdMhOQ9ja4b9iK3Ls0ZTHZ2KDhPn0mfgqkcY0 pqvHn+XBZ3XJQTdMUpFCJ9duPD0MwTlKKkl80ZocHfxksDxQUT+VQXdN/eh5KLaUXPb9o EIrtZCNBUreYzUq1w6w47389U0/sPDIreTZu/EaoubiP8zk/zEkzgXOzFlx0mYSNdhA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796070894; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=ZAwVbk66DtaDtoBZxGbT/v6ygXGYmM6kWH1NOZk/w44=; b=IkW/9iioSKvsM8COeA5GK9LO4okEE6H72h2pkAuNulTHNNvfGdhfMNHfOFW1eA3eOn6v MSBukwZdzdokTyc+6oL3QLab20jFke9MifPrRTJvFX8grMmGvaqK1uwDDaSEnt3gW2jpU vC8SIKAel/JHAhO2jmLFxKqgHLmGSo2rouHfUsH6oYQp3wvrVHvsFL+7B0nIFR0mkZrvx LVVovHRpA1w9qFRScwRBXemV1L7W8gIOfUaKiPQS1NsZnixHcR7fltuDSrdLeei/vEOzv NcTU4UGMLX5kRUkmvS3vs4i8396F6v9IWBKIrikEgH2GpJAWMzWU70bEMRwmyUmlTbg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FA5WZBuq; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD850606A31A; Mon, 30 Nov 2026 20:34:54 +0000 (UTC) X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796070894; b=bvfcRE+AaXlLAkaL2IXkwhLsgQCg7twqTFf+qZ31Nen5FmHtcjEPO2kJnDbCigy1gVLo iiT68UwyjUqIayqOb0biDAkAj6bnPiOjdtm0hePvZUzdozTHqTsJVGALFJIcJHQ+HBEqu qqajGJ35tKJl6aynFRKFUUlz/eFLv9tobkMHTKmilPx8OdAnVP1yGkasUwN4b45+TGhux w7r3y0bKMWCrWjhirsrhc1qaYGBUJfBGpX77yoBYzHfNlljuARmBHyIMueRKfcpG4k58c 2uj1JY5jvYInJuA3yWCiQPLSsrGSZqefHzVz36ph7J65HL5CK/JuczP1cMfQQeHWW9g== X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796070894; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=ZAwVbk66DtaDtoBZxGbT/v6ygXGYmM6kWH1NOZk/w44=; b=e8Iz7vFnrJD6a0J2mLqfgtdlG2Qu8sux75eL8lcaQQOZqiqcX+EjMiKI+KzLkKt/gxmh vP4xjAzLqFIgb2GuT2UW+LmsibyESdwQTS6t2fzv98KOsdOnLgI5106YVJ9F8O1D22evv 2qOQKnIiZy52Y1IV3g300axErn6teihRbbK2ldKpKZxyDAx5JV/j6ALkv4/4xRhjieV+W Z4dFknCh115YioMZJOPV9ckzhw7Vu2gDZHcTzOE89MGGWzerSm0cdUmnwCOHx2c1KvZDV 9Mtd0hHH/5fH/7jWI5vJo/u8y0PBqUkXKwn98pIyeVB9eAZbJwXhKqD8u2homcfoZww== X-ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id C16BA1F0089A; Mon, 30 Nov 2026 20:34:47 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796070894; bh=ZAwVbk66DtaDtoBZxGbT/v6ygXGYmM6kWH1NOZk/w44=; h=From:Subject:Date:To:Cc:Reply-To; b=FA5WZBuqNhz2JZCDhGsxmcff1v3rrffPqFNrh50beREM36QzvpJy4mOT5iQre946U bomJIbn/92Tu3sh2NZkl3FiYtnSLa8qIzV/tAouO8GJK7gpNgcm5rLK36mzBZWoHCl 8ba8vNxqRssMx841w3so/nJWIfX+nOXEKcLvPfu169oJcPE3Nu2M7wAwiYZvul7BE3 5NXEJL5+a2s5UY/iyJPN11Uxa54/PA0m1J4j4cDcvTchQfUckTudR3kzGbYMxe5Tz9 JFZPf+mNPEtxxX7q4oQ9KLngue1PWFbgiPDbKHRWLEXYTA86crw+UAcp2EA0kQ5oox 3uLS4ECfQmJ4Q== X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 56C244E9D1; Mon, 30 Nov 2026 20:34:47 +0000 (UTC) X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-B4-Tracking: v=1; b=H4sIAOXdDWsC/12NwQ6CMBBEf4Xs2RraBBo9+R+Gw7JdZBUoaQE1h H8X0JPHN5mZN0PkIBzhnMwQeJIovlvBHBKgGrsbK3Erg0lNrrXJFfXxqbBh1Xh6KKI0c1nJaDG FddMHruS1/12h4wGKbxjH8s40bE9brZY4+PDerZPeyz+B/RNMWmmF1lhr3Akz5Au2PYdK2B3Jt 1Asy/IBF6+J3cUAAAA= X-Change-ID: 20261126-cpsw-ale-lock-cc05d5bea7a0 X-Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, Kuniyuki Iwashima <kuniyu@google.com>, Manuel Janocha <manuel.janocha@amperfied.com>, stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796070886; l=3714; i=manuel.janocha@amperfied.com; s=20261127; h=from:subject:message-id; bh=02+etwf5ssEshoYeUPnrZojCi4Xn0zQmTps0zbJ2a7Y=; b=XcHUbUw5leQ3U7GCvTKRbu6iUHWjg/z4oTNGHsjyxCda1hO/xGoIYDXFfCv9hydrtA6RhTDHN uIq7z6+UlrIAmHI+b/wCQrD9U1DPp2A0VtD3ITvlCNaJexqsHDk4MEv X-Developer-Key: i=manuel.janocha@amperfied.com; a=ed25519; pk=DEqXiAa78UfHuuvMWJsylc0F41gl8N+i7WtqrDb4xCQ= X-Endpoint-Received: by B4 Relay for manuel.janocha@amperfied.com/20261127 with auth_id=1666 X-Original-From: Manuel Janocha <manuel.janocha@amperfied.com> X-Reply-To: manuel.janocha@amperfied.com