From 277e2385cea44cfbad30b0ff2f906a8e43c571d0 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 23 Jun 2023 16:56:05 -0700 Subject: [PATCH] lib.sh: make MAX_WAIT_FW_LOADING platform dependent We don't want to wait for 70s in every test on every platform when the firmware does not load. When multiplied by the number of tests in a plan this can cause a considerable waste of hardware resources. i915 timeout aside, 10s has proved over a long period to be more than enough. Fixes: #1059 Signed-off-by: Marc Herbert --- case-lib/config.sh | 4 +++- case-lib/lib.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/case-lib/config.sh b/case-lib/config.sh index 66a35caa..2127c8d6 100644 --- a/case-lib/config.sh +++ b/case-lib/config.sh @@ -99,4 +99,6 @@ ENABLE_STORAGE_CHECKS=${ENABLE_STORAGE_CHECKS:-0} # Set MAX Polling time to check FW Loading. If FW is already loaded, it will # return immediately. Default value is set to 60 seconds, because i915 driver # timeout is 60 seconds. -MAX_WAIT_FW_LOADING=${MAX_WAIT_FW_LOADING:-70} + +# The default value is defined in case-lib/lib.sh. You can preempt it here: +# MAX_WAIT_FW_LOADING=${MAX_WAIT_FW_LOADING:-90} diff --git a/case-lib/lib.sh b/case-lib/lib.sh index f0ed2628..f07107a2 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -77,6 +77,15 @@ start_test() return 0 } + if test -z "$MAX_WAIT_FW_LOADING"; then + local _pltf; _pltf=$("$SCRIPT_HOME/tools/sof-dump-status.py" -p) + case "$_pltf" in + # broken i915 with long timeout, see comments in config.sh + mtl) MAX_WAIT_FW_LOADING=70;; + *) MAX_WAIT_FW_LOADING=10;; # more than enough + esac + fi + # Check for whether SOF fW is loaded or not before starting any test. # Only start the polling for firmware boot complete when SOF soundcard is not available # setup_kernel_check_point has already -1 second to avoid TOCTOU race condition