Skip to contentSkip to conversation

leds: netdev trigger - misleading link state indication at boot

DISCUSSION Russell King - ARM Linux admin 2 participants 2 messages Apr 13, 2021 – Aug 4, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

I'm seeing some odd behaviour with the netdev trigger and some WiFi interfaces.

When the WiFi interface has never been brought up (so is in an operationally disabled state), if I bind a LED to the netdev trigger, setting the device_name to the WiFi interface name and enable the "link" property, the LED illuminates, indicating that the WiFi device has link - but it's disabled.

If I up/down the WiFi interface, thereby returning it to the original state, the link LED goes out.

I suspect ledtrig-netdev.c needs to check that the device is both up (dev->flags & IFF_UP) and netif_carrier_ok(dev) both return true, rather than just relying on netif_carrier_ok(). I don't think using netif_running() is appropriate, as that will return true before ndo_open() has been called to initialise the carrier state.

Agreed?

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#1 lore raw

Hi!

Quoted 12 lines

I'm seeing some odd behaviour with the netdev trigger and some WiFi interfaces.

When the WiFi interface has never been brought up (so is in an operationally disabled state), if I bind a LED to the netdev trigger, setting the device_name to the WiFi interface name and enable the "link" property, the LED illuminates, indicating that the WiFi device has link - but it's disabled.

If I up/down the WiFi interface, thereby returning it to the original state, the link LED goes out.

Quoted 7 lines

I suspect ledtrig-netdev.c needs to check that the device is both up (dev->flags & IFF_UP) and netif_carrier_ok(dev) both return true, rather than just relying on netif_carrier_ok(). I don't think using netif_running() is appropriate, as that will return true before ndo_open() has been called to initialise the carrier state.

Agreed?

Seems reasonable to me. Will you do the patch?

Best regards,
Pavel

Signature · 1 line
http://www.livejournal.com/~pavelmachek