You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SoundWire: TGL: IO error in rt711_jack_detect_handler #3459
[2022-01-29T20:15:10.418Z] 2022-01-29 20:15:09 UTC Sub-Test: [REMOTE_COMMAND] Run the command: rtcwake -m mem -s 5
[2022-01-29T20:15:10.418Z] rtcwake: wakeup from "mem" using /dev/rtc0 at Sat Jan 29 20:15:15 2022
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:16 UTC Sub-Test: [REMOTE_COMMAND] sleep for 5
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:21 UTC Sub-Test: [REMOTE_INFO] Check for the kernel log status
[2022-01-29T20:15:22.710Z] declare -- cmd="journalctl_cmd --since=@1643487301"
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:21 UTC [ERROR] Caught kernel log error
[2022-01-29T20:15:22.710Z] ===========================>>
[2022-01-29T20:15:22.710Z] [ 8113.494143] kernel: soundwire_intel soundwire_intel.link.0: IO transfer timed out, cmd 3 device 1 addr b921 len 1
[2022-01-29T20:15:22.710Z] [ 8113.494149] kernel: soundwire sdw-master-0: trf on Slave 1 failed:-110 write addr b921 count 0
[2022-01-29T20:15:22.710Z] [ 8113.494221] kernel: IO error in rt711_jack_detect_handler, ret -110
[2022-01-29T20:15:22.710Z] <<===========================
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:21 UTC Sub-Test: [REMOTE_ERROR] Caught error in kernel log
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:21 UTC Sub-Test: [REMOTE_ERROR] Starting func_exit_handler(), exit status=1, FUNCNAME stack:
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:21 UTC Sub-Test: [REMOTE_ERROR] die() @ /home/ubuntu/sof-test/test-case/../case-lib/lib.sh
[2022-01-29T20:15:22.710Z] 2022-01-29 20:15:21 UTC Sub-Test: [REMOTE_ERROR] main() @ /home/ubuntu/sof-test/test-case/check-suspend-resume.sh:91
Starting from January 29th I see one of two daily-tests failing: PASS, FAIL, PASS, FAIL,... There's no branch information in the TCR database but it looks like the topic/sof-dev daily was the one passing and the for-next daily was the one failing.
From February 2nd to February 24th, daily tests are consistently passing again.
After February 24th, daily tests are consistently failing except this one (which was on 5.16):
The first SOF Pull Requests started failing these two tests on TGLU_RVP_SDW on March 1st and then they almost never passed. #3461 was merged on Feb 28th
So in case of error print the in rt711_jack_init enable means that jack_detect_work is scheduled to run in ~250ms, the sdw core got power off and the rt711_jack_detect_handler() tries to read 0xb921 register, which is volatile, so it must reach out to the bus, but it is down, so we get -ETIMEDOUT back as error code.
Note that later on the jack detect works again when the sequence is correct (the sdw links are not powered down right away).
When there is no error we also receive interrupt, which is expected or not, I don't know.
We might be missing a cancel work calls in case the sdw is disabling the link or we need a check if the link is up at all?
@ujfalusi , I changed test script and only test hw:0,2 with suspend/resume. I did a lot of test, no reproductions after reverting e38f9ff. I'm pretty sure about the result.
Activity
plbossart commentedon Feb 25, 2022
not sure if this is related to #3401
plbossart commentedon Feb 28, 2022
Not able to reproduce with short tests on Dell SKU 0A3E that uses RT711 on link1
@bardliao can you try to see if this bug can be reproduced on your TGL devices with IPC3?
Not sure why we see this consistently on TGLU_RVP_SDW now.
bardliao commentedon Mar 1, 2022
@plbossart I tested it on my Dell SKU 0A3E and it passed. I run the test twice and both iterations are passed.
ASoC: rt711: fix race condition on suspend
ASoC: rt711: fix race condition on suspend
marc-hb commentedon Mar 8, 2022
P1 because it's happening consistently:
https://sof-ci.01.org/sofpr/PR5485/build12238/devicetest/?model=TGLU_RVP_SDW&testcase=check-suspend-resume-with-playback-5
https://sof-ci.01.org/softestpr/PR871/build1005/devicetest/?model=TGLU_RVP_SDW&testcase=check-suspend-resume-with-playback-5
https://sof-ci.01.org/sofpr/PR5475/build12242/devicetest/?model=TGLU_RVP_SDW&testcase=check-suspend-resume-with-playback-5
These test failures happened on different units.
What changed recently? Big kernel merge?
Interesting that searching for something as specific as
rt711_jack_detect_handlerreturns 11 entries no less (8 closed)https://github.com/thesofproject/linux/issues?q=rt711_jack_detect_handler
plbossart commentedon Mar 9, 2022
@marc-hb can you help find the first report of a failure? I am down to a spurious pm_runtime resume after a system suspend, no sure what is happening.
marc-hb commentedon Mar 10, 2022
I think this came with 5.17, maybe with
According to the TCR database, the very first check-suspend-playback/capture failure on TGLU_RVP_SDW happened on January 29th:
This was with
Starting from January 29th I see one of two daily-tests failing: PASS, FAIL, PASS, FAIL,... There's no branch information in the TCR database but it looks like the
topic/sof-devdaily was the one passing and thefor-nextdaily was the one failing.From February 2nd to February 24th, daily tests are consistently passing again.
After February 24th, daily tests are consistently failing except this one (which was on 5.16):
The first SOF Pull Requests started failing these two tests on TGLU_RVP_SDW on March 1st and then they almost never passed. #3461 was merged on Feb 28th
ujfalusi commentedon Mar 10, 2022
@marc-hb, @bardliao, @plbossart, I think the reason for the error is:
https://sof-ci.01.org/linuxpr/PR3461/build7243/devicetest/?model=TGLU_RVP_SDW&testcase=check-suspend-resume-with-playback-5
When it works the log looks like this:
When it fails:
So in case of error print the
in rt711_jack_init enablemeans thatjack_detect_workis scheduled to run in ~250ms, the sdw core got power off and thert711_jack_detect_handler()tries to read 0xb921 register, which is volatile, so it must reach out to the bus, but it is down, so we get -ETIMEDOUT back as error code.Note that later on the jack detect works again when the sequence is correct (the sdw links are not powered down right away).
When there is no error we also receive interrupt, which is expected or not, I don't know.
We might be missing a cancel work calls in case the sdw is disabling the link or we need a check if the link is up at all?
keqiaozhang commentedon Mar 10, 2022
@plbossart @marc-hb @ujfalusi It took me more than 6 hours to bisect this issue, lucky me, I found the bad commit:
e38f9ff
I tried to revert this commit on tip of sof-dev and verified this issue again, 3*30 iterations passed, no reproductions.
ujfalusi commentedon Mar 10, 2022
@keqiaozhang, wow!
What I have found that the issue is really easy to reproduce on tglu-rvp-sdw:
Don't forget to
killall aplayIf you would try
plughw:0,0, it never happens, only if you use a PCM which does not have the rt711 in path.Can you see if this is working as well? For me this is 100% reproduction rate.
keqiaozhang commentedon Mar 10, 2022
@ujfalusi , I changed test script and only test hw:0,2 with suspend/resume. I did a lot of test, no reproductions after reverting e38f9ff. I'm pretty sure about the result.
158 remaining items
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend
soundwire: intel: prevent pm_runtime resume prior to system suspend