🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24783

[PATCH net v2 1/2] net: ethernet: ti: cpsw_ale: serialize ALE table accesses

#24783
From: Manuel Janocha via B4 Relay
Date: Mon, 30 Nov 2026 20:34
470 lines
28607 bytes
From: Manuel Janocha <manuel.janocha@amperfied.com>

The ALE table is accessed through a single index register
(ALE_TABLE_CONTROL) and three data registers (ALE_TABLE). Reading an
entry writes the index and then reads the data registers; writing an
entry fills the data registers and then writes the index with
ALE_TABLE_WRITE. Most operations (add/del ucast/mcast/vlan,
vlan_add_modify, flush_multicast, set_allmulti, set_unreg_mcast) are
read-modify-write sequences over several entries. The driver has no
lock around any of this.

This did not matter as long as the callers were serialized by someone
else. Both ports of a CPSW switch share one ALE, but the port VLAN
and address operations run under RTNL, while ndo_set_rx_mode() of
am65-cpsw and netcp runs under netif_addr_lock_bh() of one port only
and does not take RTNL. Since IPV6_ADD_MEMBERSHIP and friends no
longer hold RTNL, joining an IPv6 multicast group
(igmp6_group_added() -> dev_mc_add() -> ndo_set_rx_mode()) can run
concurrently with a VLAN or address operation on the other port, or
on the same port.

For example, on two CPUs:

  CPU0 (eth0 rx_mode, flush)     CPU1 (eth1 add_vid)
  cpsw_ale_read(A):
    writel(A, TABLE_CONTROL)
                                 cpsw_ale_read(B):
                                   writel(B, TABLE_CONTROL)
    readl(ALE_TABLE + 0..2)
      -> returns entry B
  cpsw_ale_write(A):
    entry B is written to index A

Entry A is lost and entry B exists twice. Interleaved writes can
equally mix the data words of two entries in one table slot. The same
happens inside the multi-entry loops, so entries are written back with
foreign data or are dropped.

Observed on an AM625 board with two am65-cpsw-nuss ports in dual EMAC
mode and seven VLANs on the second port: after boot the port VLAN
entry (VID 0), the unicast entry of the first port and two VLAN
entries were gone, copies of the unicast and of the broadcast entry
showed up at two other indexes. The switch then dropped every frame
received on the first port (p0_ale_vid_ingress_drop kept rising) while
the port could still transmit, and the board was unreachable.

Add a spinlock to struct cpsw_ale and take it in all exported
functions that access the table. cpsw and cpsw_new are not affected
in practice: since commit 0b8c878d1173 ("net: cpsw: Execute
ndo_set_rx_mode callback in a work queue") they run rx_mode from a
work item under RTNL and are already serialized. The lock is put into
the ALE library instead of repeating that approach in the other
drivers because the table protocol (index plus data registers) is an
invariant of the library itself, one lock covers all users including
the ageout timer, and it does not depend on every present and future
caller holding RTNL.

The lock is taken with spin_lock_irqsave(). netcp calls
cpsw_ale_add_vlan() and cpsw_ale_del_vlan() from netcp_rx_add_vid()
and netcp_rx_kill_vid() with netcp->lock held and interrupts
disabled, so the unlock must not re-enable them. ndo_set_rx_mode()
runs with bottom halves disabled and the dev_mc_add()/dev_uc_add()
family is not restricted to process context; the other callers run
in process context (RTNL, workqueue, ethtool, system suspend). A
sleeping lock cannot be used because of the atomic callers. The
register accesses under the lock are readl_relaxed()/writel_relaxed()
as before; this patch does not change the accessors. The regmap of
the ALE is only used for the version, feature and policer fields and
is not touched under the lock.

cpsw_ale_vlan_add_modify() calls cpsw_ale_add_vlan() with the lock
held, so the body of the latter moves into a static helper that does
not take the lock. The loops over all entries run with the lock held
for the number of table entries; that is the same amount of MMIO as
before, just not preemptible by the other port.

cpsw_ale_control_set() takes the lock around its read-modify-write
as well. ALE_PORTCTL holds several fields of one port in a single
word, so two unlocked updates can lose each other's change: the
am65-cpsw rx_mode path clearing ALE_PORT_MACONLY_CAF can overwrite an
ALE_PORT_STATE write from phylink mac_link_up()/mac_link_down() or
from STP, or the other way round. In the same way cpsw_ale_timer()
setting ALE_AGEOUT in ALE_CONTROL can overwrite a concurrent update
of the bypass or flood bits. cpsw_ale_control_get() stays unlocked.
The policer index registers are separate and left alone.

The lock is held longest when a VLAN is added: with the 512 entry
table of the AM625 a backport of this patch to the TI 6.18.59 vendor
kernel measured up to 1.1 ms in cpsw_ale_vlan_add_modify() called
from ndo_vlan_rx_add_vid(). That is VLAN configuration, not the data
path; the multicast add and delete paths hold it for less.

Discovery: observed on a test system and reproduced on the same board.
The reproducer joins IPv6 multicast groups in parallel on eth0, eth1
and a VLAN interface of eth1 while adding and deleting a VLAN on eth1.
It needs no kernel modification and no error injection. Without this
change eth0 stops receiving after about 30 seconds.

Testing: hardware test on an AM625 board (two CPSW ports,
am65-cpsw-nuss) with net at v7.4-rc3 (ef3e21c61baa) plus an
out-of-tree board device tree, built with PROVE_LOCKING,
DEBUG_SPINLOCK and DEBUG_ATOMIC_SLEEP. Without this patch the
reproducer kills reception within 120 seconds
(p0_ale_vid_ingress_drop 0 -> 2366 and rising; link down/up
recovers). With this patch it ran for 120 and for 300 seconds
(about 21800 joins and 87 VLAN add/delete cycles of three VLANs in
the longer run): eth0 and the VLANs kept receiving and lockdep stayed
silent. p0_ale_vid_ingress_drop rose by 1 and by 3 during the two
runs. Over all 19 runs on net v7.4-rc3 with this patch alone, 2
failed with the VID 0 entry overwritten again. A backport to the TI
vendor kernel 6.18.59 passed 28 of 29 runs of 120 to 300 seconds; one
120 second run lost the VID 0 entry again. These remaining failures
are not missing serialization: with the lock held, a table read can
still return a wrong entry, which the next patch handles. The legacy
cpsw, cpsw_new and netcp users of the ALE were only compile-tested
(arm64 and arm, W=1).

Tooling: the port to net, the locking analysis and this changelog were
prepared with an AI coding assistant (Claude).

Fixes: 1767bb2d47b7 ("ipv6: mcast: Don't hold RTNL for IPV6_ADD_MEMBERSHIP and MCAST_JOIN_GROUP.")
Cc: stable@vger.kernel.org
Signed-off-by: Manuel Janocha <manuel.janocha@amperfied.com>
---
 drivers/net/ethernet/ti/cpsw_ale.c | 86 +++++++++++++++++++++++++++++++++-----
 drivers/net/ethernet/ti/cpsw_ale.h |  2 +
 2 files changed, 78 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 9304405c9581..8434803335d5 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -462,8 +462,10 @@ static void cpsw_ale_flush_mcast(struct cpsw_ale *ale, u32 *ale_entry,
 int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS];
+	unsigned long irq_flags;
 	int ret, idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	for (idx = 0; idx < ale->params.ale_entries; idx++) {
 		cpsw_ale_read(ale, idx, ale_entry);
 		ret = cpsw_ale_get_entry_type(ale_entry);
@@ -491,6 +493,7 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
 
 		cpsw_ale_write(ale, idx, ale_entry);
 	}
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_flush_multicast);
@@ -510,6 +513,7 @@ int cpsw_ale_add_ucast(struct cpsw_ale *ale, const u8 *addr, int port,
 		       int flags, u16 vid)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
+	unsigned long irq_flags;
 	int idx;
 
 	cpsw_ale_set_vlan_entry_type(ale_entry, flags, vid);
@@ -520,15 +524,19 @@ int cpsw_ale_add_ucast(struct cpsw_ale *ale, const u8 *addr, int port,
 	cpsw_ale_set_blocked(ale_entry, (flags & ALE_BLOCKED) ? 1 : 0);
 	cpsw_ale_set_port_num(ale_entry, port, ale->port_num_bits);
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0);
 	if (idx < 0)
 		idx = cpsw_ale_match_free(ale);
 	if (idx < 0)
 		idx = cpsw_ale_find_ageable(ale);
-	if (idx < 0)
+	if (idx < 0) {
+		spin_unlock_irqrestore(&ale->lock, irq_flags);
 		return -ENOMEM;
+	}
 
 	cpsw_ale_write(ale, idx, ale_entry);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_add_ucast);
@@ -537,14 +545,19 @@ int cpsw_ale_del_ucast(struct cpsw_ale *ale, const u8 *addr, int port,
 		       int flags, u16 vid)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
+	unsigned long irq_flags;
 	int idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0);
-	if (idx < 0)
+	if (idx < 0) {
+		spin_unlock_irqrestore(&ale->lock, irq_flags);
 		return -ENOENT;
+	}
 
 	cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
 	cpsw_ale_write(ale, idx, ale_entry);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_del_ucast);
@@ -553,8 +566,10 @@ int cpsw_ale_add_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask,
 		       int flags, u16 vid, int mcast_state)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
+	unsigned long irq_flags;
 	int idx, mask;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0);
 	if (idx >= 0)
 		cpsw_ale_read(ale, idx, ale_entry);
@@ -575,10 +590,13 @@ int cpsw_ale_add_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask,
 		idx = cpsw_ale_match_free(ale);
 	if (idx < 0)
 		idx = cpsw_ale_find_ageable(ale);
-	if (idx < 0)
+	if (idx < 0) {
+		spin_unlock_irqrestore(&ale->lock, irq_flags);
 		return -ENOMEM;
+	}
 
 	cpsw_ale_write(ale, idx, ale_entry);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_add_mcast);
@@ -587,12 +605,16 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask,
 		       int flags, u16 vid)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
+	unsigned long irq_flags;
 	int mcast_members = 0;
 	int idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0);
-	if (idx < 0)
+	if (idx < 0) {
+		spin_unlock_irqrestore(&ale->lock, irq_flags);
 		return -ENOENT;
+	}
 
 	cpsw_ale_read(ale, idx, ale_entry);
 
@@ -609,6 +631,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask,
 		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
 
 	cpsw_ale_write(ale, idx, ale_entry);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_del_mcast);
@@ -642,8 +665,8 @@ static void cpsw_ale_set_vlan_untag(struct cpsw_ale *ale, u32 *ale_entry,
 		bitmap_clear(ale->p0_untag_vid_mask, vid, 1);
 }
 
-int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port_mask, int untag,
-		      int reg_mcast, int unreg_mcast)
+static int __cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port_mask,
+			       int untag, int reg_mcast, int unreg_mcast)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
 	int idx;
@@ -681,6 +704,20 @@ int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port_mask, int untag,
 	cpsw_ale_write(ale, idx, ale_entry);
 	return 0;
 }
+
+int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port_mask, int untag,
+		      int reg_mcast, int unreg_mcast)
+{
+	unsigned long irq_flags;
+	int ret;
+
+	spin_lock_irqsave(&ale->lock, irq_flags);
+	ret = __cpsw_ale_add_vlan(ale, vid, port_mask, untag, reg_mcast,
+				  unreg_mcast);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
+
+	return ret;
+}
 EXPORT_SYMBOL_GPL(cpsw_ale_add_vlan);
 
 static void cpsw_ale_vlan_del_modify_int(struct cpsw_ale *ale,  u32 *ale_entry,
@@ -726,16 +763,21 @@ static void cpsw_ale_vlan_del_modify_int(struct cpsw_ale *ale,  u32 *ale_entry,
 int cpsw_ale_vlan_del_modify(struct cpsw_ale *ale, u16 vid, int port_mask)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
+	unsigned long irq_flags;
 	int idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_vlan(ale, vid);
-	if (idx < 0)
+	if (idx < 0) {
+		spin_unlock_irqrestore(&ale->lock, irq_flags);
 		return -ENOENT;
+	}
 
 	cpsw_ale_read(ale, idx, ale_entry);
 
 	cpsw_ale_vlan_del_modify_int(ale, ale_entry, vid, port_mask);
 	cpsw_ale_write(ale, idx, ale_entry);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 
 	return 0;
 }
@@ -744,11 +786,15 @@ EXPORT_SYMBOL_GPL(cpsw_ale_vlan_del_modify);
 int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
+	unsigned long irq_flags;
 	int members, idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_vlan(ale, vid);
-	if (idx < 0)
+	if (idx < 0) {
+		spin_unlock_irqrestore(&ale->lock, irq_flags);
 		return -ENOENT;
+	}
 
 	cpsw_ale_read(ale, idx, ale_entry);
 
@@ -771,6 +817,7 @@ int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
 	}
 
 	cpsw_ale_write(ale, idx, ale_entry);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 
 	return 0;
 }
@@ -782,8 +829,10 @@ int cpsw_ale_vlan_add_modify(struct cpsw_ale *ale, u16 vid, int port_mask,
 	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
 	int reg_mcast_members, unreg_mcast_members;
 	int vlan_members, untag_members;
+	unsigned long irq_flags;
 	int idx, ret = 0;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	idx = cpsw_ale_match_vlan(ale, vid);
 	if (idx >= 0)
 		cpsw_ale_read(ale, idx, ale_entry);
@@ -803,8 +852,9 @@ int cpsw_ale_vlan_add_modify(struct cpsw_ale *ale, u16 vid, int port_mask,
 	reg_mcast_members = (reg_mcast_members & ~port_mask) | reg_mask;
 	unreg_mcast_members = (unreg_mcast_members & ~port_mask) | unreg_mask;
 
-	ret = cpsw_ale_add_vlan(ale, vid, vlan_members, untag_members,
-				reg_mcast_members, unreg_mcast_members);
+	ret = __cpsw_ale_add_vlan(ale, vid, vlan_members, untag_members,
+				  reg_mcast_members, unreg_mcast_members);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 	if (ret) {
 		dev_err(ale->params.dev, "Unable to add vlan\n");
 		return ret;
@@ -820,9 +870,11 @@ void cpsw_ale_set_unreg_mcast(struct cpsw_ale *ale, int unreg_mcast_mask,
 			      bool add)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS];
+	unsigned long irq_flags;
 	int unreg_members = 0;
 	int type, idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	for (idx = 0; idx < ale->params.ale_entries; idx++) {
 		cpsw_ale_read(ale, idx, ale_entry);
 		type = cpsw_ale_get_entry_type(ale_entry);
@@ -841,6 +893,7 @@ void cpsw_ale_set_unreg_mcast(struct cpsw_ale *ale, int unreg_mcast_mask,
 				      unreg_members);
 		cpsw_ale_write(ale, idx, ale_entry);
 	}
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_set_unreg_mcast);
 
@@ -883,8 +936,10 @@ cpsw_ale_vlan_set_unreg_mcast_idx(struct cpsw_ale *ale, u32 *ale_entry,
 void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti, int port)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS];
+	unsigned long irq_flags;
 	int type, idx;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	for (idx = 0; idx < ale->params.ale_entries; idx++) {
 		int vlan_members;
 
@@ -907,6 +962,7 @@ void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti, int port)
 
 		cpsw_ale_write(ale, idx, ale_entry);
 	}
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_set_allmulti);
 
@@ -1140,6 +1196,7 @@ int cpsw_ale_control_set(struct cpsw_ale *ale, int port, int control,
 			 int value)
 {
 	const struct ale_control_info *info;
+	unsigned long irq_flags;
 	int offset, shift;
 	u32 tmp, mask;
 
@@ -1160,9 +1217,11 @@ int cpsw_ale_control_set(struct cpsw_ale *ale, int port, int control,
 	offset = info->offset + (port * info->port_offset);
 	shift  = info->shift  + (port * info->port_shift);
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	tmp = readl_relaxed(ale->params.ale_regs + offset);
 	tmp = (tmp & ~(mask << shift)) | (value << shift);
 	writel_relaxed(tmp, ale->params.ale_regs + offset);
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 
 	return 0;
 }
@@ -1540,6 +1599,7 @@ struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
 	ale = devm_kzalloc_obj(params->dev, *ale);
 	if (!ale)
 		return ERR_PTR(-ENOMEM);
+	spin_lock_init(&ale->lock);
 	ale->regmap = devm_regmap_init_mmio(params->dev, params->ale_regs,
 					    &ale_regmap_cfg);
 	if (IS_ERR(ale->regmap)) {
@@ -1639,23 +1699,29 @@ EXPORT_SYMBOL_GPL(cpsw_ale_create);
 
 void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
 {
+	unsigned long irq_flags;
 	int i;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	for (i = 0; i < ale->params.ale_entries; i++) {
 		cpsw_ale_read(ale, i, data);
 		data += ALE_ENTRY_WORDS;
 	}
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_dump);
 
 void cpsw_ale_restore(struct cpsw_ale *ale, u32 *data)
 {
+	unsigned long irq_flags;
 	int i;
 
+	spin_lock_irqsave(&ale->lock, irq_flags);
 	for (i = 0; i < ale->params.ale_entries; i++) {
 		cpsw_ale_write(ale, i, data);
 		data += ALE_ENTRY_WORDS;
 	}
+	spin_unlock_irqrestore(&ale->lock, irq_flags);
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_restore);
 
diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h
index 87b7d1b3a34a..8e47261161fe 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.h
+++ b/drivers/net/ethernet/ti/cpsw_ale.h
@@ -96,6 +96,8 @@ struct cpsw_ale {
 	u32			vlan_field_bits;
 	unsigned long		*p0_untag_vid_mask;
 	const struct ale_entry_fld *vlan_entry_tbl;
+	/* serializes access to the ALE table registers */
+	spinlock_t		lock;
 };
 
 enum cpsw_ale_control {

-- 
2.34.1
Technical Details
Message-ID: <20261130-cpsw-ale-lock-v2-1-c7a59d2178bb@amperfied.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374457-linux-kernel-netdev=dewy.ru
References: <20261130-cpsw-ale-lock-v2-0-c7a59d2178bb@amperfied.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374457-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 1/2] net: ethernet: ti: cpsw_ale: serialize ALE
 table accesses
Date: Mon, 30 Nov 2026 20:34:46 +0000
Organization: Usenet Network
Message-ID: <20261130-cpsw-ale-lock-v2-1-c7a59d2178bb@amperfied.com>
References: <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="1531711"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DH2zF8lZ2ZmuGMguQCLXJ4sSlN4= sha256:9bDI4cutvV97I8opkLF4VXyV3YIt+EX+qnUQW6BIoY0=
	sha1:QFnbLtrs7Hur2OCQ1gFkhibKSdU= sha256:I9NMo+hUpPkVUqg4UvEE2ysekScw/bU4MvZbnqe5BkU=
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 6850F12600A; Mon, 30 Nov 2026 23:35:14 +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 zaVKIJPkglyH;
	Mon, 30 Nov 2026 23:35:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374457-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 8FC16126006; Mon, 30 Nov 2026 23:35:02 +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 7A1412A108; Mon, 30 Nov 2026 20:35:00 +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=1796070899;
	b=oWIDVM9mn5nd0SM52wqGpmX3KF3R2Nw+oEnGz1DQQhzxMNUruqWRs3mD1TniM+M1WsnJ
	 pKZ2tLzenyX/2y/7P35yo8KpG2b3BPVxB2I5jdpNV+ffw4sXt2ff9RHf9Bafd5fsDvj8L
	 qrfKMalHohpDTwUjR9uBKxL9yBcTMQ8+VVmoUWMLHBNNrH9fd4o6gdvlF0UiJbEzjHQec
	 F7mTSMpqSyPgEsMQMvZ3MndOj+UYri44TJ2avnC5mXt6rfhWSY1GrUMv/uvuS3cKPkipz
	 dub1kAhjo6oZglEz/1rx0aL4DLYOBKFlOLD2Qx9HMWaqAY71Z8pvtif61iKAqf85H9w==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796070899;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=lCfJhPjYRo25JAPKd5YmvU1u8+8Z0gh5HJK4jc89g+U=;
	b=FBynhSd0ds9NuMN3rwWLwuW5p+5i1JW7wEi/EiPVRhVkRoW65u8HK9YKQQs/hRYFoAyA
	 IjU96seYToQWRAowjw2y+xviaRBtHg08djniSIuwLgOhrAVPy1Qy/UnBvQn4ifAEFv1dQ
	 o7JLjSzsoatBdcoxvq5bF/y3MK4HTQnNR0g2op3G6T4ihh1gsa5afPoaDva8cyo/MbuVa
	 3Fzkp0LDoNYPTwKTHQO14GZoQydb889JuYXXxrnundvCWfAqyG3uvzg+a4n7pJZp7jFZn
	 aN0pmJrcjir9i1bJsNmbCqyvz/9z5/XDMXJXO1OIwvYqRNmB1N82A0knKu5mC/bOpZg==
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=nBJ4lzOf;
	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 C1E7A606A337;
	Mon, 30 Nov 2026 20:34:59 +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=nBJ4lzOf
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=1796070898;
	b=0jSyu2uW2YlFvibAmlxsWIPm+Wa/9COuppISTQspa0qG3koJyx09PzuzKgjDkVhsYa5p
	 BRpYmvJAjtBJDN9VWQPNy+jtajqCpMuSyeUaLnWGSlmJUIrUUsmd9gUz4haLkETso4sjS
	 kLU3qrtOLBMXUdbPa8h1m4JN4uW80ytcABNUF1M1tRzZYeB5IxDAM0kAdVUqolHn61Hem
	 RgdUI82veqZES+7092iprWYRN60ynqGDct2sMWMI57mx/+mJ3E1SUf6MDQIAnxrYRn4AY
	 YuCB5zg8nJ8rngpaLbPA5vFw0oGfYSEJnX4gqqxfZw5k/JMeJyM0xaiAzWPCEpgnvGA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796070898;
	h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version:
	 Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=lCfJhPjYRo25JAPKd5YmvU1u8+8Z0gh5HJK4jc89g+U=;
	b=N9HBBN+p0FL+cK6QzB6h1ummHBl4fL4O+1vP37Kqlpb/VtEHzYoo5J0DhvwC2yVtsS8n
	 RqaUdA44/MvF5JlLC9am4be3Ya14y+VlcGWdy1cqfGJrMVFjgVSHmmNpZoasmwquK4yhA
	 6DM48e0yP0SM64mc1YKCsdRQVuzTPSVS9p+EFBRFVKe2M3NP1FqgWy6pN4B1Iuh8G9Eoa
	 uxJQ6e2LHF2DV+3LxStZM084OdCIJROdZ1iWH1Pg/QFGQOCTo5ALkdvy8jyYqdF/Eur86
	 OkDdxAhge/EKAJBHZZ5PKmJc3nwAIaPg68lw5qZdukEYeLj5rQBqvuo1694//owSwzA==
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=nBJ4lzOf;
	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 DCFE2606A327;
	Mon, 30 Nov 2026 20:34:58 +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=1796070898;
	b=POrgOWVqSdITfrvZkGgculdup2U7mLb0wSbAPwlVE807RS4JE/GGTEW0i215TOjjNKvo
	 0ABVUwk4ogttQxJyZGAynVHpHefUYJH/qMv3/0xGZnHE2G2kySIGQSWDu7ZrWHmUYd30b
	 2+bhEEbiJhs1rkaUvGE2GZbcBo01tcd884X4JBBkrlHhCFWXWpvGz38E/3D+lWIAhGW/h
	 JXZb3Xziqzit8EgPlxE1Nnj591mQ2iN3t8kVe7XvzFdVLNwhyUJreKL5UuvroNxiyG1A7
	 bCcxf6e5x4+0K/yXN9RrC86BEJF2rMnxKrfX04yo1G+51fUbtAIu8hq70vtrZQzfjWA==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1796070898;
	h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=lCfJhPjYRo25JAPKd5YmvU1u8+8Z0gh5HJK4jc89g+U=;
	b=yeupN95PJEpvQbqZoCXuH7HT39loIFfsfpeku/uzVNatHQMnYejC9XfBFRLM6soj02Gm
	 EbbrgJiLFDOgxSFW7gFdLh80FNCTsn8bkI1FHDq2kNCjFepVBp9+NlWfkhniS4+HD/YNI
	 BSWjPuwBkziHttDOlAakyY0xEOK8xf2r19md4lLya7m/g5+QI9NM4b8LdoyNCOyv3orNx
	 pWER0AOagG+0cH4WeqBhv2BHeaRwgWXohogViuqNQ5ZqXq70XOqcgVRMbr1Wu1z+1qz47
	 W/epLn7IVdQGPi0vAoJXiPGkXkTzdvgMl3YvcfLq0Y32bR7VtR6jhfZ6In1PjB3fUqA==
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 F266D1F0089B;
	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=1796070898;
	bh=lCfJhPjYRo25JAPKd5YmvU1u8+8Z0gh5HJK4jc89g+U=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To;
	b=nBJ4lzOfT620m50SwmhpZbvglH6LU7OuC4aAnsLMFSBoKlTP5hE9tdgX6P3M1fICF
	 xhTQ3++BQFK226RNM1PilVLvYSHuZ5eamCa9SxKspvjPlm+35/xZDlgoEs5gbZaeia
	 QVjm6A+oOKcQAteVXD7UXUeDt+36RNmb7LiQW9fiKkJoeSGkqJGB4D5+HUEWVE9nHi
	 jdpx7CFeWGpoNwGiTXykBvbYsoAf+1/tLEjMTCQ/7jlDAahnD2nUp3FzmX3W9JEc5p
	 FVFcmoJw684/SSI35hGVIu7T5+zIl1NZZmFhEwT+ZJbYE4ccC8wZePtQjJH/EjApCk
	 BUkLsQrmceFxg==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id 887AB4E9D5;
	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-In-Reply-To: <20261130-cpsw-ale-lock-v2-0-c7a59d2178bb@amperfied.com>
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=18157;
 i=manuel.janocha@amperfied.com; s=20261127; h=from:subject:message-id;
 bh=akdxGKHlYrHnltFyKYjjuvvrEpCQDxNOSFu5L6EjJYQ=;
 b=iJ+bkWXQqV6TJjOichKt16t0FH9pfwyWav/Onsuv7b4UCGLbVu3+S+LGZdV9wdOVOfxU94BSS
 OgkIT+vKVPEDBFqCIaTvVIVUNr4UeQjzkHUumlugNKDLf57ubh9L6t5
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