BT_ON_OFF: add Bluetooth power-on retry and failure diagnostics#466
Merged
Conversation
Enhance btloghcidiag() to support lightweight and failure diagnostic modes. The basic mode now keeps controller visibility diagnostics concise, while failure mode collects deeper evidence including hciconfig -a, bluetoothctl show/list, rfkill state, bluetooth.service status, Bluetooth journal logs, Bluetooth-related dmesg, scan_dmesg_errors output, and Bluetooth firmware candidates. Make firmware discovery target-agnostic by scanning generic QCA firmware locations instead of hardcoding a single QCA6698 path. Use existing print_path_meta() when available to avoid fragile ls-based file listing. This improves LAVA failure triage for QCA/WCN Bluetooth controller recovery issues without adding noise to passing runs. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Add configurable OFF-to-ON settle delay and controlled power-on retry handling to the BT_ON_OFF test. Some QCA/WCN UART Bluetooth controllers may not recover immediately after Powered=no. In LAVA this can lead to power-on failures during firmware or NVM setup, such as HCI command timeouts, while the same image may pass in a local setup. The test now: - waits before requesting Power ON after successful Power OFF - retries Power ON using configurable attempt and delay values - optionally unblocks Bluetooth through rfkill before retry - optionally restarts bluetooth.service before retry - captures full Bluetooth diagnostics on real failure paths - keeps persistent failure to restore Powered=yes as a test failure - reports retry recovery as PASS with warning Update the BT_ON_OFF LAVA YAML to expose the new runtime knobs while preserving the existing single BT_ON_OFF.res result flow. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
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
BT_ON_OFFreliability and failure triage for Bluetooth controller power-cycle validation.The test now adds a configurable OFF-to-ON settle delay and controlled Power ON retry flow. This helps handle timing-sensitive QCA/WCN UART controllers that may not be ready immediately after
Powered=no.The PR also improves Bluetooth diagnostics so LAVA failures include enough evidence to distinguish controller recovery issues, firmware/NVM transfer failures, rfkill state problems, bluetoothd issues, and platform timing problems.
Failure mode now collects:
hciconfig -abluetoothctl listbluetoothctl showrfkill listsystemctl status bluetooth --no-pagerjournalctl -u bluetooth -b --no-pager | tail -100dmesgtailscan_dmesg_errorsoutput when a test path is providedFirmware diagnostics are no longer hardcoded to
QCA6698; the helper now scans generic QCA firmware locations and usesprint_path_meta()when available to avoid fragilelsparsing.Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/[run.sh](http://run.sh/)Add runtime-configurable controls:
BT_POWER_CYCLE_DELAYBT_POWER_ON_ATTEMPTSBT_POWER_ON_RETRY_DELAYBT_RESTART_SERVICE_ON_RETRY