WiFi_OnOff: add bounded recovery for missing WiFi interface#490
Merged
Conversation
WiFi_OnOff can intermittently fail when WiFi modules are loaded but no wlan interface is created before the wait timeout. The existing wait_for_wifi_interface() only unblocks rfkill and triggers udev once, so it does not recover cases where the WiFi leaf driver needs a soft reprobe. Extend wait_for_wifi_interface() to perform one controlled reload of a loaded WiFi leaf driver module after the interface has not appeared for a bounded time. The recovery path is limited to WiFi leaf/platform modules and intentionally avoids shared modules such as cfg80211, mac80211, and mhi. Also tighten wifi_stack_present() so it reports success only when runtime WiFi evidence exists, such as a wlan netdev, ieee80211 phy, iw phy/dev output, or wireless sysfs markers. Module-only state no longer causes missing-interface paths to be treated as a real WiFi runtime stack. All diagnostic logging from wait_for_wifi_interface() is kept on stderr so callers using command substitution receive only the interface name on stdout. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update WiFi_OnOff to use the enhanced WiFi interface wait/recovery flow from lib_connectivity.sh. Add runtime knobs for the bounded recovery path: - WIFI_RECOVERY_RELOAD - WIFI_RECOVERY_RELOAD_AFTER_S Also narrow the default DT match patterns to avoid treating Bluetooth-only compatible strings such as qcom,wcn6855-bt as WiFi DT evidence. The test now prefers WiFi-specific patterns such as ath12k, ath11k, ath10k, wifi, wlan, and qca. When no WiFi interface is found after wait/recovery, classify the result more accurately: - fail if WiFi probe/runtime errors are detected - fail if a runtime WiFi stack is exposed but no usable interface is found - skip if only module-level evidence exists and no WiFi phy/netdev/runtime object is exposed This keeps real WiFi driver failures visible while avoiding misleading failures when no WiFi runtime device is registered. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
vnarapar
reviewed
Jun 13, 2026
|
|
||
| log_warn "No WiFi interface after ${waited}s; attempting one controlled reload of $mod" >&2 | ||
|
|
||
| if modprobe -r "$mod" >/dev/null 2>&1; then |
Contributor
There was a problem hiding this comment.
Why do test script reload the module here? Isnt it needs to be taken care by Kernel to safely loada modules on bootup? or by udev?
Contributor
Author
There was a problem hiding this comment.
Why do test script reload the module here? Isnt it needs to be taken care by Kernel to safely loada modules on bootup? or by udev?
we do not reload modules during the normal path.
-
Wait for WiFi interface normally
- rfkill unblock
- get_wifi_interface retry
- udev trigger/settle
-
If interface appears
- no module reload
- continue toggle test
-
Only if interface does not appear after part of the wait
- attempt one controlled reload
- only for an already-loaded WiFi leaf driver module
bhargav0610
approved these changes
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve WiFi_OnOff robustness for intermittent cases where WiFi modules are loaded but no WiFi interface is exposed before the wait timeout.
The test can intermittently fail in LAVA even though WiFi kernel configs and modules are present. In these cases, no usable WiFi runtime object is exposed:
no WiFi interface from get_wifi_interface
empty iw dev
empty iw phy
empty /sys/class/ieee80211
Sample lava job for reference https://lava.infra.foundries.io/scheduler/job/263091