Skip to content

Commit 0ce4dd2

Browse files
committed
lib: start polling for fw boot complete only when sof card is not present
SOF soundcard is already listed it is ready to start the test. If not, set the KERNEL_CHECKPOINT and start polling for FW boot complete. This is a bug fix for fceeee0. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
1 parent d929d91 commit 0ce4dd2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

case-lib/lib.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,19 @@ start_test()
7777
return 0
7878
}
7979

80-
# Check for whether SOF fW is loaded or not before starting any test
81-
# without --since=@"$KERNEL_CHECKPOINT", it will be scan for current boot
82-
# fw loaded -> sof module removed case can't be detected.
83-
# Mainly it is going to check whether the sof-test can be started after boot/reboot
80+
# Check for whether SOF fW is loaded or not before starting any test.
81+
# Only start the polling for firmware boot complete when SOF soundcard is not available
82+
# setup_kernel_check_point has already -1 second to avoid TOCTOU race condition
83+
is_sof_used || {
8484
if [ -z "$NO_POLL_FW_LOADING" ]; then
85-
if poll_wait_for 1 "$MAX_WAIT_FW_LOADING" sof_firmware_boot_complete; then
85+
setup_kernel_check_point
86+
if poll_wait_for 1 "$MAX_WAIT_FW_LOADING" sof_firmware_boot_complete --since=@"$KERNEL_CHECKPOINT"; then
8687
dlogi "Good to start the test, FW is loaded!"
8788
else
8889
die "FW is not loaded for $MAX_WAIT_FW_LOADING"
8990
fi
9091
fi
92+
}
9193

9294
export SOF_TEST_TOP_PID="$$"
9395
local prefix; prefix="ktime=$(ktime) sof-test PID=${SOF_TEST_TOP_PID}"

0 commit comments

Comments
 (0)