Skip to content

Commit

Permalink
kmod-load-unload: search logs for "firmware boot complete"
Browse files Browse the repository at this point in the history
Stop relying on verify-sof-firmware-load.sh in
check-kmod-load-unload.sh. The former has some serious issues:

- It passes even after unloading the firmware
- It has a misleading name
- It looks for firmware versions instead of "firmware boot complete",
  which is not compatible with IPC4.

Add new sof_firmware_boot_complete() function that can be re-used to fix
verify-sof-firmware-load.sh later.

Fixes #845

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and plbossart committed Feb 16, 2022
1 parent a73fe26 commit 71a9cca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@ disable_kernel_check_point()
KERNEL_CHECKPOINT="disabled"
}

# "$@" is optional, usually: --since=@"$epoch_checkpoint"
# shellcheck disable=SC2120
sof_firmware_boot_complete()
{
journalctl_cmd "$@" --grep 'sof.*firmware[[:blank:]]*boot[[:blank:]]*complete'
}

is_zephyr()
{
local ldcFile
Expand Down
5 changes: 4 additions & 1 deletion test-case/check-kmod-load-unload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ do
die "Found error(s) in kernel log after module insertion"

dlogi "checking if firmware is loaded successfully"
"$(dirname "${BASH_SOURCE[0]}")"/verify-sof-firmware-load.sh ||
if sof_firmware_boot_complete --since=@"$KERNEL_CHECKPOINT"; then
grep_firmware_info_in_logs --since=@"$KERNEL_CHECKPOINT"
else
die "Failed to load firmware after module insertion"
fi

# successful remove/insert module pass
dlogi "==== firmware boot complete: $idx of $loop_cnt ===="
Expand Down

0 comments on commit 71a9cca

Please sign in to comment.