automated: linux: add remoteproc smoke test - #634
Conversation
Some remoteprocs silently fail to come up, e.g. when their firmware can't be loaded after an initramfs update. Add a smoke test which enumerates every remoteproc and checks that it reached the running or attached state. Auto-detect all remoteprocs by default; set DEVICE to target specific ones. Some remoteprocs are not booted by the kernel at all, either because no firmware is shipped for them or because another subsystem owns their lifecycle, e.g. ath11k for wpss. Skip modem and wpss by default rather than failing them, and make the list a parameter since it varies per SoC. Their state is still logged to help triage. Boards without any remoteproc report remoteproc-device-exists as skip instead of failing. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
| local name="$1" | ||
| for dir in $(list_remoteprocs); do | ||
| [ "$(cat "${dir}/name")" = "${name}" ] && echo "${dir}" | ||
| done |
| # remoteprocs are booted asynchronously, so they may not be enumerated yet | ||
| wait_for_device | ||
|
|
||
| if [ -n "${DEVICE}" ]; then |
There was a problem hiding this comment.
So this checks if device has remoteproc. I would use report_skip "remoteproc-device-exists" and report_pass "remoteproc-device-exists" at the top of the test.
Something like
all_dirs="$(list_remoteprocs)"
if [ -z "${all_dirs}" ]; then
report_skip "remoteproc-device-exists"
else
report_pass "remoteproc-device-exists"
fi
(and catch it at the bottom of this function). So you will get a remoteproc-device-exists skip when no remoteprocs are found
| local name | ||
| name="$(cat "${dir}/name")" | ||
| if [ "$(remoteprocs_by_name "${name}" | wc -l)" -gt 1 ]; then | ||
| echo "remoteproc-${name}-$(basename "${dir}")-running" |
There was a problem hiding this comment.
Will the name will be stable across boots. Could we not use basename "$(readlink -f "${dir}/device")" to get a reliable name beforehand, just to be sure.
| # a requested remoteproc which doesn't exist is a failure, unless it is one | ||
| # which is not expected to be running anyway | ||
| dirs="" | ||
| for name in ${DEVICE}; do |
There was a problem hiding this comment.
Might be worth a cheap dedupe call here.
Some remoteprocs silently fail to come up, e.g. when their firmware
can't be loaded after an initramfs update.
Add a smoke test which enumerates every remoteproc and checks that it
reached the running or attached state. Auto-detect all remoteprocs by
default; set DEVICE to target specific ones.
Some remoteprocs are not booted by the kernel at all, either because no
firmware is shipped for them or because another subsystem owns their
lifecycle, e.g. ath11k for wpss. Skip modem and wpss by default
rather than failing them, and make the list a parameter since it
varies per SoC. Their state is still logged to help triage. Boards
without any remoteproc report remoteproc-device-exists as skip
instead of failing.