drivers/leds/trigger/ledtrig-netdev.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
This reverts commit c629c972b310af41e9e072febb6dae9a299edde6.
While .led_blink_set() would previously put an LED into an unconditional
permanently blinking state, the offending commit now uses same operation
to (also?) set the blink timing of the netdev trigger when offloading.
This breaks many if not all of the existing PHY drivers which offer
offloading LED operations, as those drivers would just put the LED into
blinking state after .led_blink_set() has been called.
Unfortunately the change even made it into stable kernels for unknown
reasons, so it should be reverted there as well.
Fixes: c629c972b310a ("leds: trigger: netdev: Configure LED blink interval for HW offload")
Link: https://lore.kernel.org/linux-leds/c6134e26-2e45-4121-aa15-58aaef327201@lunn.ch/T/#m9d6fe81bbcb273e59f12bbedbd633edd32118387
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/leds/trigger/ledtrig-netdev.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
index 4e048e08c4fde..c15efe3e50780 100644
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -68,7 +68,6 @@ struct led_netdev_data {
unsigned int last_activity;
unsigned long mode;
- unsigned long blink_delay;
int link_speed;
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported_link_modes);
u8 duplex;
@@ -87,10 +86,6 @@ static void set_baseline_state(struct led_netdev_data *trigger_data)
/* Already validated, hw control is possible with the requested mode */
if (trigger_data->hw_control) {
led_cdev->hw_control_set(led_cdev, trigger_data->mode);
- if (led_cdev->blink_set) {
- led_cdev->blink_set(led_cdev, &trigger_data->blink_delay,
- &trigger_data->blink_delay);
- }
return;
}
@@ -459,11 +454,10 @@ static ssize_t interval_store(struct device *dev,
size_t size)
{
struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
- struct led_classdev *led_cdev = trigger_data->led_cdev;
unsigned long value;
int ret;
- if (trigger_data->hw_control && !led_cdev->blink_set)
+ if (trigger_data->hw_control)
return -EINVAL;
ret = kstrtoul(buf, 0, &value);
@@ -472,13 +466,9 @@ static ssize_t interval_store(struct device *dev,
/* impose some basic bounds on the timer interval */
if (value >= 5 && value <= 10000) {
- if (trigger_data->hw_control) {
- trigger_data->blink_delay = value;
- } else {
- cancel_delayed_work_sync(&trigger_data->work);
+ cancel_delayed_work_sync(&trigger_data->work);
- atomic_set(&trigger_data->interval, msecs_to_jiffies(value));
- }
+ atomic_set(&trigger_data->interval, msecs_to_jiffies(value));
set_baseline_state(trigger_data); /* resets timer */
}
--
2.50.1
On Sat, 12 Jul 2025 16:39:21 +0100, Daniel Golle wrote: > This reverts commit c629c972b310af41e9e072febb6dae9a299edde6. > > While .led_blink_set() would previously put an LED into an unconditional > permanently blinking state, the offending commit now uses same operation > to (also?) set the blink timing of the netdev trigger when offloading. > > This breaks many if not all of the existing PHY drivers which offer > offloading LED operations, as those drivers would just put the LED into > blinking state after .led_blink_set() has been called. > > [...] Applied, thanks! [1/1] Revert "leds: trigger: netdev: Configure LED blink interval for HW offload" commit: 26f732791f2bcab18f59c61915bbe35225f30136 -- Lee Jones [李琼斯]
On Sat, Jul 12, 2025 at 04:39:21PM +0100, Daniel Golle wrote: > This reverts commit c629c972b310af41e9e072febb6dae9a299edde6. > > While .led_blink_set() would previously put an LED into an unconditional > permanently blinking state, the offending commit now uses same operation > to (also?) set the blink timing of the netdev trigger when offloading. > > This breaks many if not all of the existing PHY drivers which offer > offloading LED operations, as those drivers would just put the LED into > blinking state after .led_blink_set() has been called. > > Unfortunately the change even made it into stable kernels for unknown > reasons, so it should be reverted there as well. > > Fixes: c629c972b310a ("leds: trigger: netdev: Configure LED blink interval for HW offload") > Link: https://lore.kernel.org/linux-leds/c6134e26-2e45-4121-aa15-58aaef327201@lunn.ch/T/#m9d6fe81bbcb273e59f12bbedbd633edd32118387 > Suggested-by: Andrew Lunn <andrew@lunn.ch> > Cc: stable@vger.kernel.org > Signed-off-by: Daniel Golle <daniel@makrotopia.org> Thanks for extending the commit message. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
© 2016 - 2025 Red Hat, Inc.