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/2026…%40jmu.edu.cn