Skip to content

Conversation

@marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Feb 18, 2022

check-kmod-load-unload: wait 10 seconds for firmware to boot

Now that the test has been just fixed in commit 71a9cca, of course
it started failing:

https://sof-ci.01.org/sofpr/PR5383/build12069/devicetest/?model=BYT_MB_NOCODEC&testcase=check-kmod-load-unload-after-playback

This proves the older version wasn't testing anything: classic case of
"green failure"
https://github.com/thesofproject/sof-test/issues?q=+label%3A%22False+Pass+%2F+green+failure%22+

Firmware does not boot instantly. We even have retries:

thesofproject/linux#3255
thesofproject/linux@2a3c9269474c

So, poll journalctl for a maximum of 10 seconds before failing.


lib.sh: add new poll_wait_for() function

This will immediately be used for waiting until the firmware is loaded
but is generic and will be useful in other places.

This will immediately be used for waiting until the firmware is loaded
but is generic and will be useful in other places.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Feb 18, 2022

suspend/resume timeout in https://sof-ci.01.org/softestpr/PR862/build983/devicetest/?model=APL_UP2_NOCODEC_ZEPHYR&testcase=check-suspend-resume-with-capture-5, everything else is green

Logs of the modified tests look as expected.

@marc-hb marc-hb changed the title check-kmod-load-unload: wait 5 seconds for firmware to bootNew function poll_wait_for(). check-kmod-load-unload: wait 5 seconds for firmware to boot. New function poll_wait_for(). Feb 18, 2022
@marc-hb marc-hb marked this pull request as ready for review February 18, 2022 05:01
@marc-hb marc-hb requested a review from a team as a code owner February 18, 2022 05:01
@marc-hb
Copy link
Collaborator Author

marc-hb commented Feb 18, 2022

@plbossart , @ujfalusi , what is the maximum time we should wait between modprobe completion and 'firmware boot complete' message?

@plbossart
Copy link
Member

@plbossart , @ujfalusi , what is the maximum time we should wait between modprobe completion and 'firmware boot complete' message?

modprobe completion means we will execute the driver probe, but for SOF it's handled in a workqueue. In addition we will do a request_module() for HDaudio stuff, and i915 IIRC, so in theory it could take a while. I think in those cases it's not uncommon to wait 60s.

The firmware download itself should not take longer than 500ms, even with the worst sand-bagging in the world and retries.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Feb 18, 2022

so in theory it could take a while. I think in those cases it's not uncommon to wait 60s.

60s?!? Wow! Is that only in pathological cases like this i915 timeout:

... or do you have "regular" cases in mind too? I would return to the vendor a computer that forces me to wait 1minute after resume before using audio.

I'm reluctant to have a long timeout by default because on the systems we test right now it usually takes less than 1 second and if it starts taking much longer for the exact same configurations then I think we should be made aware. Then we could always extend on a per-product basis.

@plbossart
Copy link
Member

@marc-hb 60s is just one way of expressing a dependency on things that take time - but we don't know how much.

Make that 10-15s for test scripts and that should be good enough

Now that the test has been just fixed in commit 71a9cca, of course
it started failing:

https://sof-ci.01.org/sofpr/PR5383/build12069/devicetest/?model=BYT_MB_NOCODEC&testcase=check-kmod-load-unload-after-playback

This proves the older version wasn't testing anything: classic case of
"green failure"
https://github.com/thesofproject/sof-test/issues?q=+label%3A%22False+Pass+%2F+green+failure%22+

Firmware does not boot instantly. We even have retries for when it
fails:

thesofproject/linux#3255
thesofproject/linux@2a3c9269474c

So, poll journalctl for a maximum of 10 seconds before failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb marc-hb changed the title check-kmod-load-unload: wait 5 seconds for firmware to boot. New function poll_wait_for(). check-kmod-load-unload: wait up to 10 seconds for firmware to boot. New function poll_wait_for(). Feb 18, 2022
@marc-hb
Copy link
Collaborator Author

marc-hb commented Feb 18, 2022

timeout changed to 10s

@marc-hb
Copy link
Collaborator Author

marc-hb commented Feb 19, 2022

SOFCI TEST

poll_wait_for()
{
test $# -ge 3 ||
die "poll_wait_for() invoked with $# arguments"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the user use it wrong, maybe we should inform the correct usage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but this function is not meant to be used outside sof-test, so the only user using it wrong is either you or me.

More seriously, the only user using it wrong is someone writing sof-test code who can just open the file and look at the header above = what they should have done already before even starting to use the function.

@marc-hb marc-hb merged commit 6b7a826 into thesofproject:main Feb 23, 2022
@marc-hb marc-hb deleted the poll-in-reload branch February 23, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants