From: Manuel Janocha netcp_rx_add_vid() and netcp_rx_kill_vid() take netcp->lock with spin_lock_irqsave(). The lock only protects the module list walk and is otherwise taken in netcp_set_rx_mode() with spin_lock() under netif_addr_lock_bh(), and with spin_lock_irqsave() in the hook registration functions, which run in process context. It is never taken from hard interrupt context. Both callbacks are ndo_vlan_rx_add_vid and ndo_vlan_rx_kill_vid, which the VLAN core calls in process context. The callbacks end up in gbe_add_vid() and gbe_del_vid(), which call cpsw_ale_add_vlan() and cpsw_ale_del_vlan(). These scan the whole ALE table with MMIO accesses and run with interrupts disabled for that time. Use spin_lock_bh() instead. This keeps the exclusion against netcp_set_rx_mode() and does not disable hard interrupts. The next patch, "net: ethernet: ti: cpsw_ale: serialize ALE table accesses", makes cpsw_ale_add_vlan() and cpsw_ale_del_vlan() take a lock with spin_lock_bh(). With netcp->lock still taken by spin_lock_irqsave(), spin_unlock_bh() would then run with hard interrupts disabled, which trips lockdep_assert_irqs_enabled() in __local_bh_enable_ip() and can run pending softirqs with interrupts off. That patch needs this one to be correct, so this one carries the same Fixes tag and both are backported together. Testing: compile-tested only (arm, multi_v7_defconfig with the netcp drivers enabled, W=1). No hardware with netcp was available. Tooling: this patch and its 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 --- drivers/net/ethernet/ti/netcp_core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c index f5e093dc983b..09fa4c732155 100644 --- a/drivers/net/ethernet/ti/netcp_core.c +++ b/drivers/net/ethernet/ti/netcp_core.c @@ -1881,12 +1881,11 @@ static int netcp_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) struct netcp_intf *netcp = netdev_priv(ndev); struct netcp_intf_modpriv *intf_modpriv; struct netcp_module *module; - unsigned long flags; int err = 0; dev_dbg(netcp->ndev_dev, "adding rx vlan id: %d\n", vid); - spin_lock_irqsave(&netcp->lock, flags); + spin_lock_bh(&netcp->lock); for_each_module(netcp, intf_modpriv) { module = intf_modpriv->netcp_module; if ((module->add_vid) && (vid != 0)) { @@ -1898,7 +1897,7 @@ static int netcp_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) } } } - spin_unlock_irqrestore(&netcp->lock, flags); + spin_unlock_bh(&netcp->lock); return err; } @@ -1908,12 +1907,11 @@ static int netcp_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) struct netcp_intf *netcp = netdev_priv(ndev); struct netcp_intf_modpriv *intf_modpriv; struct netcp_module *module; - unsigned long flags; int err = 0; dev_dbg(netcp->ndev_dev, "removing rx vlan id: %d\n", vid); - spin_lock_irqsave(&netcp->lock, flags); + spin_lock_bh(&netcp->lock); for_each_module(netcp, intf_modpriv) { module = intf_modpriv->netcp_module; if (module->del_vid) { @@ -1925,7 +1923,7 @@ static int netcp_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) } } } - spin_unlock_irqrestore(&netcp->lock, flags); + spin_unlock_bh(&netcp->lock); return err; } -- 2.34.1