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 code fix in as21xxx_led_hw_control_set() (drivers/net/phy/as21xxx.c) is correct. -- net: phy: as21xxx: Fix LED hw control set for unsupported rules With this patch, as21xxx_led_hw_control_set() returns -EOPNOTSUPP when the requested rules match no entry in as21xxx_led_supported_pattern. Before, it wrote event 0 to the LED register and returned success. The patch also drops the zero initialization of val, which is no longer needed.
> as21xxx_led_hw_control_set() looks up the requested rules in > as21xxx_led_supported_pattern, but does not check whether a match was > found. If the rules are not in the table, val keeps its initial value > of 0, so phy_modify_mmd() still gets called, overwriting the current LED > configuration with event 0, and the function returns success.
[Severity: Low] The code change looks correct. Could the commit message also say how an unsupported rule set reaches this callback, and what the user sees? The only in-tree caller of hw_control_set() is set_baseline_state() in drivers/leds/trigger/ledtrig-netdev.c. The usual ways into it are netdev_led_attr_store() and NETDEV_UP. Both go through can_hw_control(), which calls hw_control_is_supported() first. as21xxx_led_hw_is_supported() checks the same as21xxx_led_supported_pattern table, so from the message alone the bug can look unreachable. It can be reached through netdev_trig_activate(): drivers/leds/trigger/ledtrig-netdev.c:netdev_trig_activate() { ... trigger_data->hw_control = true; set_device_name(trigger_data, name, strlen(name)); rc = led_cdev->hw_control_get(led_cdev, &mode); if (!rc) trigger_data->mode = mode; ... } as21xxx_led_hw_control_get() returns -EINVAL when the A_EVENT field holds a value that is not in the table. as21xxx_led_brightness_set() writes two such values: VEND1_LED_REG_A_EVENT_ON and VEND1_LED_REG_A_EVENT_OFF. One way to trigger this is to set the trigger to none, which turns the LED off and writes OFF, and then set it back to netdev. After that, hw_control is true but trigger_data->mode is still 0. Any later NETDEV_CHANGE, NETDEV_DOWN or NETDEV_CHANGENAME event, or a write to device_name, then calls hw_control_set() with rules == 0: drivers/leds/trigger/ledtrig-netdev.c:set_baseline_state() { ... if (trigger_data->hw_control) { led_cdev->hw_control_set(led_cdev, trigger_data->mode); return; } ... } Before this patch that wrote event 0, which is VEND1_LED_REG_A_EVENT_ON_10. The LED was silently reprogrammed to "on at 10M link". set_baseline_state() also ignores the return value, so the caller never sees the new -EOPNOTSUPP. In practice, the fix just stops the register from being overwritten. Would it help reviewers and stable backporters if the commit message described this path and the "on at 10M link" symptom?
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40collabora.com