From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796295438; b=KJHxy7UnIs5gMFgyBgkyqsyUoG8Ozt2y8QmMDtAF8yCNuK5CpQFp0IxQYjtKrZXB+3c0 oJH7g9psc/D1cJEKztuwA5O7Ziw9cimMhwhrCVBGvIJq8gMlZse+9cg/+OL+J0f6/2ptJ zOheWPcDgeQdBhZSKdmT4RHw35V8gUAOWVMyclzec4TAdzAJBMk7c7zryy9bIE4xAmKtU eqefghWF6GSacTOs3yI82iNeX0puYgI6JXib8sDhVA69mCpAzrbCP5QFGZnj9xr/I/aJN /ZJRcp0Jw4UaeA2ACh16Wd+LBCeBY3hhOipukJia/9gRhxYQ9teUu3TMo++u7iE1NOw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295438; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=O5d9gBcuk+4aF7PkT9OHDFBF2TlP99/hfR6MyA4KvMA=; b=mSkR1Fg2yfgP51okO9teZG+2ozTioBGIhK0wZj4YtashngYjoCxVF1yqMhCDrOO/Rgnz +v3kMBquyJ/u4nDp4cmuIXAWW05NULPTom/kpSYidp/3uLCMWeyq2d7h+beRIKKlO+ddS OOw8axy5cWIYBTMinofVMl2QDa5d/gBNccR0AHz+ltF83rzQm4dL6VW1mdbzeECa/FgA6 +tPWyeoDDM85dLSAUnsNFmA0zvEoSbnBa9nfiZHOGUjx/HEDj0Q7GRf+2J5TpxvPvZOEI lozHmDDCeMeZJDw6vkAibK+Ut5fep7Vr1nhwM3VfhxxC7OtElEYc2OKGPFfq/OkJyDQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hc1PXppI; arc=none smtp.remote-ip=100.103.45.18 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 10896606A33B; Thu, 3 Dec 2026 10:57:17 +0000 (UTC) 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=hc1PXppI Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF8EB1F000C1; Thu, 3 Dec 2026 10:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796295437; bh=O5d9gBcuk+4aF7PkT9OHDFBF2TlP99/hfR6MyA4KvMA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hc1PXppIi0vevWNl0ovKqb/JOVyp9MQTTFVO3x4uEVmELSUad9MZbAU6oQdjbWDX/ gC0RyZefbxqwZJnbpqM5+y/wdDzWo0dS0s0SLKIfaEiVSNDiB1YxcNBo/DKYN6RADh dGMBqmGynv5gHCR3OcrkMl4yW0vWXs2I5N+Y1ADvc1kgYgdmS/lk5j4SNwDVxPxyOo WCHUerJLKJH/tx4ixdrrcPXqGf0gyLGyQrdZe1LvifIb03KTCB7J64BtW6vcQmk00N HzSrU2Ryc+DmyO86+n1Kcz5SLts22lFIZHyzqCtbD4dG5TryENgAfbS3gfz+2hiYhI GiDOIxxQ4/pEw== Subject: Re: [PATCH net v3 1/4] net: netcp: do not disable interrupts in the VLAN callbacks From: netdev-bot+sashiko@kernel.org To: manuel.janocha@amperfied.com Cc: s-vadapalli@ti.com, rogerq@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, vigneshr@ti.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org, kuniyu@google.com Date: Thu, 03 Dec 2026 10:57:16 +0000 Message-ID: <179629543648.3146.13965202360925036247@kernel.org> In-Reply-To: <20261202-cpsw-ale-lock-v3-1-b40dc361d6b9@amperfied.com> References: <20261202-cpsw-ale-lock-v3-1-b40dc361d6b9@amperfied.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The stable tagging and changelog of this patch leave out its real reason for existing. Pre-existing issues: - [Low] The comment on struct netcp_intf::lock in drivers/net/ethernet/ti/netcp.h:117 ("Lock used for protecting Rx/Tx… -- net: netcp: do not disable interrupts in the VLAN callbacks This commit changes netcp_rx_add_vid() and netcp_rx_kill_vid() to take netcp->lock with spin_lock_bh() instead of spin_lock_irqsave(). With this change, the ALE table scans in cpsw_ale_add_vlan() and cpsw_ale_del_vlan() no longer run with hard interrupts disabled. The changelog also calls it a prerequisite for the next patch, which adds a BH lock in the ALE library. > Use spin_lock_bh() instead. This keeps the exclusion against > netcp_set_rx_mode() and does not disable hard interrupts. It is also a > prerequisite for the next patch, which takes a lock in the ALE library > with spin_lock_bh(), so that no caller holds off interrupts while it > scans the table. [ ... ] > Cc: stable@vger.kernel.org > Signed-off-by: Manuel Janocha [Severity: Low] This patch is tagged for stable but has no Fixes: tag, and "the next patch" is not named. Should the changelog state the correctness dependency more directly? The later patch in the series, "net: ethernet: ti: cpsw_ale: serialize ALE table accesses", makes cpsw_ale_add_vlan() and cpsw_ale_del_vlan() take ale->lock with spin_lock_bh(). Those functions are reached with netcp->lock held: netcp_rx_add_vid() spin_lock_irqsave(&netcp->lock, flags); <- before this patch module->add_vid() gbe_add_vid() cpsw_ale_add_vlan() spin_lock_bh(&ale->lock); ... spin_unlock_bh(&ale->lock); The same applies to netcp_rx_kill_vid()->gbe_del_vid()->cpsw_ale_del_vlan(). If the ALE patch is backported without this one, spin_unlock_bh() runs with hard IRQs disabled. That trips lockdep_assert_irqs_enabled() in __local_bh_enable_ip(), and pending softirqs can run inside the IRQs-off region. The changelog presents this only as an interrupt latency improvement. Could it say that the ALE locking patch needs this one to be correct, and name that patch? Should it also carry a Fixes: tag matching that patch (which targets 1767bb2d47b7), so stable backporters pick up both together? For reference, the irqsave in these callbacks came from 8ceaf361ffd131 ("net: netcp: fix deadlock reported by lockup detector"). Before that, 84640e27f230 used mutex_lock() here. > diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c > index f5e093dc983b5..09fa4c7321554 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) { [Severity: Low] This is a pre-existing issue and was not introduced by this patch. The comment on the lock in struct netcp_intf in drivers/net/ethernet/ti/netcp.h says: /* Lock used for protecting Rx/Tx hook list management */ spinlock_t lock; The lock is also used for other things: - netcp_set_rx_mode() takes it around the addr_list mark/sweep. - netcp_rx_add_vid() and netcp_rx_kill_vid() take it around the module_head walk and the add_vid/del_vid callbacks. The code that changes module_head does not take netcp->lock. That includes the list_add_tail() in netcp_module_probe() and the list_for_each_entry_safe() removal loops in netcp_release_module() and netcp_delete_interface(). The changelog gives a third description, "The lock only protects the module list walk". Would it be worth updating the comment in netcp.h to describe what netcp->lock actually serializes? The mismatch dates back to 8ceaf361ffd131, and it does not affect whether the conversion to the bh variant is correct. > module = intf_modpriv->netcp_module; > if ((module->add_vid) && (vid != 0)) { [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-cpsw-ale-lock-v3-0-b40dc361d6b9%40amperfied.com