I am noticing the same phenomena on two platforms already (ath9k and ath10k (mips and ipq4019):
When the device boots with the radio (phy0-ap0) disabled, the interface is down and the associated LED is off. If I enable the radio, the associated LED turns on. But once I turn the same radio off again, the radio goes down, but the phy0-ap0 interface stays up, and the netdev trigger fails to disable the associated LED.
This definitely worked on 5.10 before, now it fails on two platforms.
This is the LED config:
config led 'led_wlan'
option name 'WLAN'
option sysfs 'green:wlan'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'phy0-ap0'
Or maybe something changed and this needs to be configured differently?
I'm trying to repro this on ath10k with r7800 and with the netdev trigger led it does correctly turn off...
Also can't find a device on ipq4019 that use netdev trigger to handle wifi led.
The exact same netifd "BUG" is displayed on the GLI-MIFI as well:
Thu Mar 23 18:31:45 2023 daemon.notice netifd: radio0 (6905): WARNING: Variable 'data' does not exist or is not an array/object
Thu Mar 23 18:31:45 2023 daemon.notice netifd: radio0 (6905): Bug: PHY is undefined for device 'radio0'
Thu Mar 23 18:31:45 2023 daemon.notice netifd: Wireless device 'radio0' is now down
Yeah, it is clear that it is not the LED trig where the problem is but the interface state handling.
This is the requested output:
Thu Mar 23 18:48:04 2023 daemon.notice netifd: radio0 (11231): WARNING: Variable 'data' does not exist or is not an array/object
Thu Mar 23 18:48:04 2023 daemon.notice netifd: radio0 (11231): Bug: PHY is undefined for device 'radio0'
Thu Mar 23 18:48:04 2023 daemon.notice netifd: Wireless device 'radio0' is now down
Thu Mar 23 18:48:04 2023 kern.info kernel: [ 848.403022] device phy0-ap0 left promiscuous mode
Thu Mar 23 18:48:04 2023 kern.info kernel: [ 848.406526] br-lan: port 3(phy0-ap0) entered disabled state
MOD: FYI, after "wifi down" this is how Luci looks like:
The previous issue with the Wireless interface not going down when disabled is still happening on latest master, but today I noticed that something changed recently (last 2-3 weeks) and the PPP interface also triggers the netdev led trig somehow although the interface never reaches UP state:
Fri Jun 9 19:52:37 2023 daemon.notice pppd[17021]: Modem hangup
Fri Jun 9 19:52:37 2023 daemon.notice pppd[17021]: Connection terminated.
Fri Jun 9 19:52:38 2023 daemon.info pppd[17021]: Exit.
Fri Jun 9 19:52:38 2023 daemon.notice netifd: Interface 'LTE' is now down
Fri Jun 9 19:52:38 2023 daemon.notice netifd: Interface 'LTE' is setting up now
Fri Jun 9 19:52:40 2023 daemon.notice pppd[17155]: pppd 2.4.9 started by root, uid 0
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: abort on (BUSY)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: abort on (NO CARRIER)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: abort on (ERROR)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: report (CONNECT)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: timeout set to 10 seconds
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: send (AT&F^M)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: expect (OK)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: AT&F^M^M
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: OK
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: -- got it
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: send (ATE1^M)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: expect (OK)
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: ^M
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: ATE1^M^M
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: OK
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: -- got it
Fri Jun 9 19:52:41 2023 local2.info chat[17156]: send (AT+CGDCONT=1,"IP",""^M)
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: timeout set to 30 seconds
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: expect (OK)
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: ^M
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: AT+CGDCONT=1,"IP",""^M^M
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: OK
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: -- got it
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: send (ATD*99***1#^M)
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: expect (CONNECT)
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: ^M
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: ATD*99***1#^M^M
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: CONNECT
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: -- got it
Fri Jun 9 19:52:42 2023 local2.info chat[17156]: send ( ^M)
Fri Jun 9 19:52:42 2023 daemon.info pppd[17155]: Serial connection established.
Fri Jun 9 19:52:42 2023 kern.info kernel: [ 8590.393083] 3g-LTE: renamed from ppp0
Fri Jun 9 19:52:42 2023 daemon.info pppd[17155]: Renamed interface ppp0 to 3g-LTE
Fri Jun 9 19:52:42 2023 daemon.info pppd[17155]: Using interface 3g-LTE
Fri Jun 9 19:52:42 2023 daemon.notice pppd[17155]: Connect: 3g-LTE <--> /dev/ttyUSB3
The LED is only off between Interface 'LTE' is now down and Serial connection established. and stays ON during the 15 seconds redial timeout. Again: this modem never reaches connected state so the LED should be (and always been) OFF.
The difference between thetwo issues is that the Wireless IF never goes to a DOWN state, in this case PPP never reaches UP state yet the LED is ON.
Would be really nice to get some help with this @nbd@hauke
@Ansuel Reverting to commit 223004b4d6e5d17c0ae99e15d0f4c591676b4f44 (kernel: bump 5.15 to 5.15.114) fixes the PPP interface LED issue, this proves that this was really a recent change from the last 10 days. I will try to narrow down on it.
FYI, I tested an IPQ4019 target on the new 6.1 kernel and even with routerboot-v7 (John's patch sets for routerboot-v7 and LZ77) it works fine. This was just a quick compile and flash test, more in depth perf tests will follow in the next couple weeks.
And the netdev problem seems to be solved in the last 2 weeks by Felix's patches of netifd.