All of lore.kernel.org
 help / color / mirror / Atom feed
* leds: netdev trigger - misleading link state indication at boot
@ 2021-04-13 18:20 Russell King - ARM Linux admin
  2021-08-04 16:01 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Russell King - ARM Linux admin @ 2021-04-13 18:20 UTC (permalink / raw)
  To: Ben Whitten, Dan Murphy; +Cc: linux-leds, netdev

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?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: leds: netdev trigger - misleading link state indication at boot
  2021-04-13 18:20 leds: netdev trigger - misleading link state indication at boot Russell King - ARM Linux admin
@ 2021-08-04 16:01 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2021-08-04 16:01 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Ben Whitten, Dan Murphy, linux-leds, netdev

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

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?

Seems reasonable to me. Will you do the patch?

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-04 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 18:20 leds: netdev trigger - misleading link state indication at boot Russell King - ARM Linux admin
2021-08-04 16:01 ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.