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=1796319998; b=odQUo98AgKtNKHfNq2VxsUg8srCiSmDAii4XqqgDp52nhcbAlUuUsmkzBSGY3MTP2KfJ JQqryp2L4c5v2emFi9HSOysEGhggsdUpnKCgTOMh0qwDY15qIcG8GN0OeTl2fMKes95qn RQAMewrXxa16atUEfk84QsdgIgIhyE6CgZF1PBufa1jzfmm1cfmvNhM0Xal+07+0ds8kx DXzZr+XZO438CohRmEd5ZRKUT6ugVV9WnWrax9UC8uRfE93PXrufiJ0sSSAPBd3QeayTH DiqpQZG+By5O1WqXJt45KkSaZZTvc9GTpGitNpR/7H9wdl/hBjGx0pbrKmzLwxUba+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796319998; 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=f1SF2yvqRwAdRRkxh2r6Z2FGaS1Fc0AzCSCd+rLMPk4=; b=ikiDaa+RAcRfzl53DtBw6cBIdBjIdVyY4Q5laqt4VkmUink28R1oUunDCtUrT5jQVp7g pcXXPBRY8XRVlByAzVMZEyKGu0Ii84U23GhEjfE7nWq//9WA+u7ApoyttyMIqS6bRHvLs y9ivZYAlbuQMf+HS8xBKVp1WPUCtmCHPSqNksu6rcs1LBaQnZdn0PsfvtiE2L6vdLRrJZ wFP3SkwD7uTQ1mz9vz1C7W8wQ1g6n6Jn1omiggOLrmsZShOmulXMgZmOqmnNcSKoKPvPM DVvsIRLUNv3YU/pWbWufMK8BCVzkVFy12Wz92JvNxjoqyafNDIGQoq+swZGzR/5esug== 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=L3ulT2w8; 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 E75A7606A683; Thu, 3 Dec 2026 17:46:37 +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=L3ulT2w8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E04A1F0092A; Thu, 3 Dec 2026 17:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796319997; bh=f1SF2yvqRwAdRRkxh2r6Z2FGaS1Fc0AzCSCd+rLMPk4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=L3ulT2w8W4IjE8HN07QjOol1wEqJPGTL1qncO1WR0aJ9fcH2GD8P2Ej+JilChxeNM QgBHtezVCGfmvmIhv9Qs5hLnrgxbF329PScdxdo5aANSPQYzr+wVJYwuFE9qHE4KDv LgiYiB+CSYZejUpemD+j5idfyaRXsXEiQ4iMGmII6NryNq0AS2n+IzQBpwH9xDfk+I R3P5MuHOii+7CMPWdp/mFMRFFZ7cata6HbvwoQ84VSwtEOW+3nWkyBBd4ksxsN0KQf NeHmVgsW0ZE8siZzNc6VHVhzW8icmQu+UI4lqcG2PGLlBqGo+RYArQ4meaxiyGzUdx c1dEoUFsjt+Qg== Subject: Re: [PATCH net-next v13 15/15] net: ethernet: onsemi: s2500: Add driver support for S2500 From: netdev-bot+sashiko@kernel.org To: Selvamani.Rajagopal@onsemi.com Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, parthiban.veerasooran@microchip.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, richardcochran@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, edumazet@kernel.org, piergiorgio.beruto@gmail.com, willemb@google.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, jerry.ray@microchip.com, ciprian.regus@analog.com Date: Thu, 03 Dec 2026 17:46:35 +0000 Message-ID: <179631999583.3146.12032673410320909910@kernel.org> In-Reply-To: <20261202-s2500-mac-phy-support-v13-15-a2908fad2693@onsemi.com> References: <20261202-s2500-mac-phy-support-v13-15-a2908fad2693@onsemi.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: devicetree@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 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] A failed live MAC address change can leave unicast receive permanently broken. - [Low] The commit message says `imply NET_SELFTESTS` was added "so that users would be able to disable self-test and still compile". -- net: ethernet: onsemi: s2500: Add driver support for S2500 This adds a driver for the onsemi S2500 10BASE-T1S MAC-PHY, built on the OPEN Alliance TC6 framework. It covers PTP, ethtool statistics and register dumps, and unicast and multicast address filtering. It also adds self-test support through net_selftest. > diff --git a/drivers/net/ethernet/onsemi/s2500/Kconfig b/drivers/net/ethernet/onsemi/s2500/Kconfig > new file mode 100644 > index 0000000000000..4bd28dc560e64 > --- /dev/null > +++ b/drivers/net/ethernet/onsemi/s2500/Kconfig > @@ -0,0 +1,20 @@ [ ... ] > +config S2500_MACPHY > + tristate "S2500 support" > + depends on SPI > + depends on PTP_1588_CLOCK_OPTIONAL > + imply NET_SELFTESTS [Severity: Low] The commit message says: Support self-test. Also Add imply NET_SELFTESTS in Kconfig so that users would be able to disable self-test and still compile. Is that accurate? NET_SELFTESTS in net/Kconfig has no prompt: config NET_SELFTESTS def_tristate PHYLIB depends on PHYLIB && INET S2500_MACPHY selects OA_TC6, and OA_TC6 selects PHYLIB, so PHYLIB is always at least as high as S2500_MACPHY. For a symbol with no prompt, the implied value is combined with the default, and the default is already PHYLIB. So this line doesn't change the value of NET_SELFTESTS, and users can't turn self-tests off on their own. Building with NET_SELFTESTS=n (for example with INET=n) works because of the stubs in include/net/selftests.h, not because of the imply. The guard in s2500_get_sset_count() also looks unnecessary, because the stub net_selftest_get_count() already returns 0: case ETH_SS_TEST: if (!IS_ENABLED(CONFIG_NET_SELFTESTS)) return -EOPNOTSUPP; return net_selftest_get_count(); Could the commit message be updated to say what the imply actually does? > diff --git a/drivers/net/ethernet/onsemi/s2500/s2500_main.c b/drivers/net/ethernet/onsemi/s2500/s2500_main.c > new file mode 100644 > index 0000000000000..88e0aec94bdbe > --- /dev/null > +++ b/drivers/net/ethernet/onsemi/s2500/s2500_main.c > @@ -0,0 +1,504 @@ [ ... ] > +/* Writes MAC address to macphy registers */ > +static int s2500_write_filter(struct s2500_info *priv, int slot, > + const u8 *mac) > +{ > + u8 mms = OA_TC6_MAC_MMS1; > + u32 val; > + int ret; > + > + ret = oa_tc6_write_register_mms(priv->tc6, mms, > + S2500_REG_MAC_ADDRMASKL(slot), > + 0xffffffff); > + if (ret) > + return ret; [ ... ] > + val = S2500_MAC_ADDRFILT_ENABLE | get_unaligned_be16(mac); > + > + return oa_tc6_write_register_mms(priv->tc6, mms, > + S2500_REG_MAC_ADDRFILTH(slot), val); > +} > + > +static int s2500_set_mac_filter(struct net_device *ndev, const u8 *mac) > +{ > + struct s2500_info *priv = netdev_priv(ndev); > + int ret; > + > + /* Disable slot 0 before programming its address. */ > + ret = oa_tc6_write_register_mms(priv->tc6, OA_TC6_MAC_MMS1, > + S2500_REG_MAC_ADDRFILTH(0), 0); > + if (ret) > + return ret; > + > + return s2500_write_filter(priv, 0, mac); > +} [ ... ] > +static int s2500_set_mac_address(struct net_device *ndev, void *p) > +{ > + struct sockaddr *addr = p; > + int ret; > + > + ret = eth_prepare_mac_addr_change(ndev, p); > + if (ret) > + return ret; > + > + ret = s2500_set_mac_filter(ndev, addr->sa_data); > + if (ret) > + return ret; [Severity: Medium] What happens to unicast receive if one of the writes in s2500_write_filter() fails here? IFF_LIVE_ADDR_CHANGE is set, so this can run while the interface is up with RXEN and ADRF set. s2500_set_mac_filter() first writes ADDRFILTH(0) = 0. s2500_write_filter() then makes four separate control writes and sets S2500_MAC_ADDRFILT_ENABLE only in the last one. Any of those writes can fail. Examples are -EPROTO from oa_tc6_check_ctrl_write_reply() when the echo does not match, or an SPI transfer error. On that path s2500_set_mac_address() returns the error without reprogramming slot 0 with the old ndev->dev_addr. Slot 0 stays disabled while ADRF is still set. Wouldn't the MAC-PHY then drop every unicast frame for this node, while dev_addr still holds the old address? Nothing else seems to reprogram slot 0 afterwards. s2500_set_rx_mode() only touches promiscuous mode and multicast slots 1-3, and s2500_open() does not call s2500_init(). The problem would therefore survive a down/up cycle until a later MAC change succeeds or the driver is re-probed. Would it make sense to write ndev->dev_addr back into slot 0 when this fails? > + > + eth_commit_mac_addr_change(ndev, p); > + return 0; > +} -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-s2500-mac-phy-support-v13-0-a2908fad2693%40onsemi.com