From 45f50234d8d51c5bebc2b22f5df6801017213340 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 6 Sep 2023 16:23:16 +0300 Subject: [PATCH] check-sof-logger: use poll_wait_for() in reload_drivers() Use poll_wait_for() to implement polling for DSP boot. Signed-off-by: Kai Vehmanen Suggested-by: Marc Herbert --- test-case/check-sof-logger.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test-case/check-sof-logger.sh b/test-case/check-sof-logger.sh index 42df779f..836a56d2 100755 --- a/test-case/check-sof-logger.sh +++ b/test-case/check-sof-logger.sh @@ -234,15 +234,11 @@ reload_drivers() # The DSP may unfortunately need multiple retries to boot, see # https://github.com/thesofproject/sof/issues/3395 dlogi "Polling ${CARD_NODE}, waiting for DSP boot..." - for i in $(seq 1 "${MAX_WAIT_FW_LOADING}" ); do - if sudo test -e ${CARD_NODE} ; then - dlogi "Found ${CARD_NODE}." - break; - fi - sleep 1 - done - - test -e ${CARD_NODE} || die "DSP did not boot (node ${CARD_NODE})" + if poll_wait_for 1 "$MAX_WAIT_FW_LOADING" sudo test -e ${CARD_NODE} ; then + dlogi "Found ${CARD_NODE}." + else + die "DSP did not boot (node ${CARD_NODE})" + fi } main()