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=1796122691; b=rcI+FvDovP4HgF61S7KeKvMEVn4PPpD7zHRQNtWm84Myn8GTfiwhPPwQi8vm/6oq7nHN SHtf6Gmni5anFex6Gvw0HnDh1C6Ess+Vrmm64Wc5NGxqu49Hm9YdUU8Rbla2+IPSyY0cn SbZAy7Hp7GiC3CazQgVMKrzSAF+1DSfkF8d30o46+t0B0H9vyMOD5r6ILAZ+eRmKg/xes vQCs+nhiW3A/K+sCpU/Ih+JAdDwm8j1zCZFQ/O+4z/t1trJnldevoQSn5szWm3E9uXEEQ b7jpGYKA7gKNocNquplFg+CoRtM0G3caPeqfq+Z5gJgy3VR40TbG/hNuVMU+k49bfBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796122691; 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=YnNnxMeroWKF/MR8thhUJBIBxfAK7o5u4Na2UXosyWI=; b=Y2LZrn/6JSIh5YJBJCIv0vE9TJfzrSS0rFM7hQgvNQeQMdf88Kyw+/UwFzPAmH/xiQOW /clrS01tTVdOIFUdeKNE/np/tSrNz+E9xzfYkToVVLIab0CVAaieSl9Co8AoJsVxDRpIn FHV4QH0QRHP8r6R/BIJnWRoPmklcGVfzIHHLbiMiRAAk1A861ZU16vmwNR/vmIhhByoPz 7VT7y5ghND179finrThUS9p9c+N0OO31Fi97boBuY89UXYgO42wxMfhzNxBXbn8+JWFoD SASjR6olqkS9LNKgVcoovkwIpAtEynH7/3lcCmm+/KyqGGaLXfC1DmzWwNXNXMzGL6w== 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="FB1D+3/6"; 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 CDEF2606A334; Tue, 1 Dec 2026 10:58:11 +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=FB1D+3/6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D91FF1F00898; Tue, 1 Dec 2026 10:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796122691; bh=YnNnxMeroWKF/MR8thhUJBIBxfAK7o5u4Na2UXosyWI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FB1D+3/6UdPmTHEKNmIz+/Iko2Zz2DUfZXR/oqbLwIP0g4UUG6SjD1XTYUOiLxHna TETuuoYhbpU+K3rmCntCOqiznMwMkLNyJSomnGOZ/bHi9rAWU3RenCIu2wDz4jzRZw qlLtQRIXxHzfc5GMYlWxXIIBGLT0vnDD5loTPHH6r9Pl3GGDkTLP6AQ2zWX+Gp7xpM 9TftsZnfYkwG/cU74AdDs2cy8XLuSbi5bj7IecPy1tQ4Hp/YIrq/hRtqxmYQodlBMy vs1N6gzo5hiFdRpTXnSMl38h8OPU/oQeRCvh1vBGHmyqj6lQxcTCIjSwHTBU1OnzYB KEsGuBo/vx+Ag== Subject: Re: [PATCH net-next v3 2/2] net: phy: motorcomm: add missing trigger link for YT8521 From: netdev-bot+sashiko@kernel.org To: amadeus@jmu.edu.cn Cc: Frank.Sae@motor-comm.com, andrew@lunn.ch, pabeni@redhat.com, kuba@kernel.org, edumazet@kernel.org, davem@davemloft.net, hkallweit1@gmail.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Date: Tue, 01 Dec 2026 10:58:10 +0000 Message-ID: <179612269042.3146.16320045925624198098@kernel.org> In-Reply-To: <20261130100001.3346131-2-amadeus@jmu.edu.cn> References: <20261130100001.3346131-2-amadeus@jmu.edu.cn> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@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] After this patch, yt8521_led_hw_control_get() (drivers/net/phy/motorcomm.c) still sets TRIGGER_NETDEV_LINK_10,… - [Low] The commit says it adds a 'missing' TRIGGER_NETDEV_LINK readback to yt8521_led_hw_control_get(), i.e. it fixes an omission. -- net: phy: motorcomm: add missing trigger link for YT8521 This commit makes yt8521_led_hw_control_get() report TRIGGER_NETDEV_LINK when the 10, 100 and 1000 ON_EN bits are all set in the LED config register. This mirrors what yt8521_led_hw_control_set() does for TRIGGER_NETDEV_LINK. > net: phy: motorcomm: add missing trigger link for YT8521 > > TRIGGER_NETDEV_LINK is available in led_hw_control_set, > but missing in led_hw_control_get. Add it. [Severity: Low] This reads as a fix for an omission, but there is no Fixes: tag. Both yt8521_led_hw_control_get() and the TRIGGER_NETDEV_LINK handling in yt8521_led_hw_control_set() came from this commit: Fixes: 355b82c54c12 ("net: phy: motorcomm: Add support for PHY LEDs on YT8521") Should that tag be added? The subject says "for YT8521", but the YT8531 phy_driver entry uses the same callback: .led_hw_control_get = yt8521_led_hw_control_get, So YT8531 behaviour changes as well. Adding a Fixes: tag would also mark the LINK plus LINK_xxx issue below for stable backport. It may be worth resolving that issue first. > diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c > index e0c6477a53e44..27aee44a420fb 100644 > --- a/drivers/net/phy/motorcomm.c > +++ b/drivers/net/phy/motorcomm.c > @@ -1919,6 +1919,11 @@ static int yt8521_led_hw_control_get(struct phy_device *phydev, u8 index, > if (val & YT8521_LED_10_ON_EN) > __set_bit(TRIGGER_NETDEV_LINK_10, rules); > > + if ((val & YT8521_LED_10_ON_EN) && > + (val & YT8521_LED_100_ON_EN) && > + (val & YT8521_LED_1000_ON_EN)) > + __set_bit(TRIGGER_NETDEV_LINK, rules); [Severity: Medium] The code just above still sets TRIGGER_NETDEV_LINK_10, LINK_100 and LINK_1000 for each enabled speed bit. When all three bits are set, the returned rules become LINK | LINK_10 | LINK_100 | LINK_1000. Does ledtrig-netdev accept that combination? yt8521_led_hw_control_set() writes exactly this register state when link is selected: drivers/net/phy/motorcomm.c:yt8521_led_hw_control_set() { ... if (test_bit(TRIGGER_NETDEV_LINK, &rules)) { val |= YT8521_LED_10_ON_EN; val |= YT8521_LED_100_ON_EN; val |= YT8521_LED_1000_ON_EN; } ... } A bootloader or hardware default with all three bits set would read back the same way. netdev_trig_activate() copies the hw_control_get() result straight into trigger_data->mode: drivers/leds/trigger/ledtrig-netdev.c:netdev_trig_activate() { ... rc = led_cdev->hw_control_get(led_cdev, &mode); if (!rc) trigger_data->mode = mode; ... } netdev_led_attr_store() then starts from trigger_data->mode, flips one bit, and rejects the result: drivers/leds/trigger/ledtrig-netdev.c:netdev_led_attr_store() { ... if (test_bit(TRIGGER_NETDEV_LINK, &mode) && (test_bit(TRIGGER_NETDEV_LINK_10, &mode) || test_bit(TRIGGER_NETDEV_LINK_100, &mode) || test_bit(TRIGGER_NETDEV_LINK_1000, &mode) || ... return -EINVAL; ... } Once the netdev trigger is active on such an LED, wouldn't these writes all fail with -EINVAL? echo 1 > tx echo 0 > rx echo 0 > full_duplex echo 0 > link_100 echo 1 > link Only "echo 0 > link" would succeed. Sysfs would also show link=1 together with link_10, link_100 and link_1000 set to 1. The store path itself never allows that state. Before this patch, the same register value read back as LINK_10 | LINK_100 | LINK_1000 without LINK. That passes the check, and attribute writes worked. Both YT8521 and YT8531 are affected, since they share this callback. realtek_main.c (rtl8211f, rtl8211e, rtl822x) and air_an8801.c use the same pattern, but this patch adds it to the motorcomm driver. Could the code report only TRIGGER_NETDEV_LINK, and skip the LINK_10/100/1000 bits, when all three speed bits are set? The other option would be to make ledtrig-netdev normalise or accept this combination. [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130100001.3346131-1-amadeus%40jmu.edu.cn