Backport initial LEDs hw control support. Currently this is limited to only rx/tx and link events for the netdev trigger but the API got accepted and the additional modes are working on and will be backported later. Refresh every patch and add the additional config flag for QCA8K new LEDs support. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
35 lines
1.3 KiB
Diff
35 lines
1.3 KiB
Diff
From cee4bd16c3195a701be683f7da9e88c6e11acb73 Mon Sep 17 00:00:00 2001
|
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
|
Date: Wed, 19 Apr 2023 23:07:39 +0200
|
|
Subject: [PATCH 1/5] leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on
|
|
dev rename
|
|
|
|
Dev can be renamed also while up for supported device. We currently
|
|
wrongly clear the NETDEV_LED_MODE_LINKUP flag on NETDEV_CHANGENAME
|
|
event.
|
|
|
|
Fix this by rechecking if the carrier is ok on NETDEV_CHANGENAME and
|
|
correctly set the NETDEV_LED_MODE_LINKUP bit.
|
|
|
|
Fixes: 5f820ed52371 ("leds: trigger: netdev: fix handling on interface rename")
|
|
Cc: stable@vger.kernel.org # v5.5+
|
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
|
Signed-off-by: Lee Jones <lee@kernel.org>
|
|
Link: https://lore.kernel.org/r/20230419210743.3594-2-ansuelsmth@gmail.com
|
|
---
|
|
drivers/leds/trigger/ledtrig-netdev.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
--- a/drivers/leds/trigger/ledtrig-netdev.c
|
|
+++ b/drivers/leds/trigger/ledtrig-netdev.c
|
|
@@ -318,6 +318,9 @@ static int netdev_trig_notify(struct not
|
|
clear_bit(NETDEV_LED_MODE_LINKUP, &trigger_data->mode);
|
|
switch (evt) {
|
|
case NETDEV_CHANGENAME:
|
|
+ if (netif_carrier_ok(dev))
|
|
+ set_bit(NETDEV_LED_MODE_LINKUP, &trigger_data->mode);
|
|
+ fallthrough;
|
|
case NETDEV_REGISTER:
|
|
if (trigger_data->net_dev)
|
|
dev_put(trigger_data->net_dev);
|