Skip to content

Commit 908ebcf

Browse files
committed
test(bt_fw_kmd_service): downgrade missing retained FW log to runtime warn
Treat missing retained BT firmware-load signatures as WARN when the runtime Bluetooth state is otherwise healthy. Keep hard failure only when both firmware-log validation and runtime BT health checks indicate a real problem. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent b1e7dde commit 908ebcf

1 file changed

Lines changed: 45 additions & 18 deletions

File tree

  • Runner/suites/Connectivity/Bluetooth/BT_FW_KMD_Service

Runner/suites/Connectivity/Bluetooth/BT_FW_KMD_Service/run.sh

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3-
# SPDX-License-Identifier: BSD-3-Clause#
3+
# SPDX-License-Identifier: BSD-3-Clause
44
# BT_FW_KMD_Service - Bluetooth FW + KMD + service + controller infra validation
55
# Non-expect version, using lib_bluetooth.sh helpers.
66

@@ -38,7 +38,7 @@ fi
3838

3939
# ---------- CLI / env parameters ----------
4040
BT_ADAPTER="${BT_ADAPTER-}"
41-
41+
4242
while [ "$#" -gt 0 ]; do
4343
case "$1" in
4444
--adapter)
@@ -72,8 +72,8 @@ inc_warn() { WARN_COUNT=$((WARN_COUNT + 1)); }
7272
log_info "------------------------------------------------------------"
7373
log_info "Starting $TESTNAME"
7474

75-
log_info "Checking dependencies: bluetoothctl hciconfig dmesg lsmod"
76-
if ! check_dependencies bluetoothctl hciconfig dmesg lsmod; then
75+
log_info "Checking dependencies: bluetoothctl hciconfig lsmod"
76+
if ! check_dependencies bluetoothctl hciconfig lsmod; then
7777
echo "$TESTNAME SKIP" > "$RES_FILE"
7878
exit 0
7979
fi
@@ -87,13 +87,13 @@ else
8787
fi
8888

8989
# ---------- DT node / compatible ----------
90-
BT_COMPAT_LIST="
91-
qcom,wcn7850-bt
92-
qcom,wcn6855-bt
93-
qcom,bluetooth
94-
"
95-
96-
if dt_confirm_node_or_compatible_all "BT" "$BT_COMPAT_LIST"; then
90+
# ---------- DT node / compatible ----------
91+
if dt_confirm_node_or_compatible_all \
92+
"qcom,wcn7850-bt" \
93+
"qcom,wcn6855-bt" \
94+
"qcom,wcn6750-bt" \
95+
"qcom,bluetooth"
96+
then
9797
log_pass "DT node/compatible for BT present (at least one entry matched)."
9898
else
9999
log_fail "DT node/compatible for BT NOT found."
@@ -108,26 +108,53 @@ else
108108
inc_warn
109109
fi
110110

111-
# ---------- Firmware load dmesg ----------
111+
# ---------- Firmware load kernel log ----------
112112
if command -v btfwloaded >/dev/null 2>&1; then
113113
btfwloaded
114114
rc=$?
115115
case "$rc" in
116116
0)
117-
log_pass "Firmware load/setup appears completed (dmesg)."
117+
log_pass "Firmware load/setup appears completed (kernel log)."
118118
;;
119119
2)
120-
log_warn "Firmware load/setup completed after retry, transient errors seen earlier (dmesg)."
120+
log_warn "Firmware load/setup completed after retry, transient errors seen earlier (kernel log)."
121121
inc_warn
122122
;;
123123
*)
124-
log_fail "Firmware load/setup does NOT look clean (see recent Bluetooth/QCA/WCN dmesg lines above)."
125-
inc_fail
124+
runtime_bt_ok=1
125+
fallback_adapter="$BT_ADAPTER"
126+
127+
if [ -z "$fallback_adapter" ] && findhcisysfs >/dev/null 2>&1; then
128+
fallback_adapter="$(findhcisysfs 2>/dev/null || true)"
129+
fi
130+
131+
if ! btkmdpresent; then
132+
runtime_bt_ok=0
133+
fi
134+
if ! bthcipresent; then
135+
runtime_bt_ok=0
136+
fi
137+
if ! btsvcactive; then
138+
runtime_bt_ok=0
139+
fi
140+
if [ -n "$fallback_adapter" ]; then
141+
if ! btbdok "$fallback_adapter"; then
142+
runtime_bt_ok=0
143+
fi
144+
fi
145+
146+
if [ "$runtime_bt_ok" -eq 1 ]; then
147+
log_warn "No retained BT firmware-load signature found, but BT runtime state is healthy."
148+
inc_warn
149+
else
150+
log_fail "Firmware load/setup does NOT look clean and BT runtime state is also unhealthy."
151+
inc_fail
152+
fi
126153
;;
127154
esac
128155
else
129156
# No SKIP: continue test, just warn.
130-
log_warn "btfwloaded() helper not available firmware-load dmesg validation not performed."
157+
log_warn "btfwloaded() helper not available; firmware-load kernel-log validation not performed."
131158
inc_warn
132159
fi
133160

@@ -166,7 +193,7 @@ elif findhcisysfs >/dev/null 2>&1; then
166193
else
167194
ADAPTER=""
168195
fi
169-
196+
170197
if [ -z "$ADAPTER" ]; then
171198
log_warn "No HCI adapter found; skipping BT FW/KMD test."
172199
echo "$TESTNAME SKIP" > "./$TESTNAME.res"

0 commit comments

Comments
 (0)