Patch "leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     leds-trigger-netdev-recheck-netdev_led_mode_linkup-o.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 51da6a19c73a5e484b709a73850d9ff55f694a52
Author: Christian Marangi <ansuelsmth@xxxxxxxxx>
Date:   Wed Apr 19 23:07:39 2023 +0200

    leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename
    
    [ Upstream commit cee4bd16c3195a701be683f7da9e88c6e11acb73 ]
    
    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@xxxxxxxxxxxxxxx # v5.5+
    Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
    Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
    Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230419210743.3594-2-ansuelsmth@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
index d5e774d830215..f4d670ec30bcb 100644
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -318,6 +318,9 @@ static int netdev_trig_notify(struct notifier_block *nb,
 	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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux