linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Ben Whitten <ben.whitten@gmail.com>, Dan Murphy <dmurphy@ti.com>
Cc: linux-leds@vger.kernel.org, netdev@vger.kernel.org
Subject: leds: netdev trigger - misleading link state indication at boot
Date: Tue, 13 Apr 2021 19:20:51 +0100	[thread overview]
Message-ID: <20210413182051.GR1463@shell.armlinux.org.uk> (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?

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

             reply	other threads:[~2021-04-13 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 18:20 Russell King - ARM Linux admin [this message]
2021-08-04 16:01 ` leds: netdev trigger - misleading link state indication at boot Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210413182051.GR1463@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=ben.whitten@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).