Repository navigation
[BUG] [MTL] soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out #4233
Copy link
Copy link
Closed
Labels
Intel Daily testsThis issue can be found in Intel internal daily testsThis issue can be found in Intel internal daily testsMTLApplies to Meteor Lake platform.Applies to Meteor Lake platform.P3Low-impact bugs or featuresLow-impact bugs or featuresSDWApplies to SoundWire bus for codec connectionApplies to SoundWire bus for codec connection
Description
Describe the bug
Found this issue in CI daily test on MTL-SDW platform. This issue happened when testing suspend/resume without audio. But it's very hard to reproduce.
dmesg
[ 112.372990] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx reply: 0x67000000|0x0: MOD_SET_DX
[ 112.373301] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx done : 0x47000000|0x0: MOD_SET_DX [data size: 8]
[ 112.373521] kernel: snd_sof_intel_hda_common:mtl_enable_sdw_irq: sof-audio-pci-intel-mtl 0000:00:1f.3: FW Poll Status: reg[0x114c]=0x0 successful
[ 112.874434] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 112.874490] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 read addr a000 count 0
[ 112.874545] kernel: rt711-sdca sdw:0:025d:0711:01: Failed to get private value: 5800000 => 2580 ret=-5
[ 113.378380] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 113.378429] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 read addr 8000 count 0
[ 113.378478] kernel: rt711-sdca sdw:0:025d:0711:01: Failed to get private value: 5800000 => 2580 ret=-5
[ 113.882314] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 113.882329] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 read addr 8000 count 0
[ 113.882340] kernel: rt711-sdca sdw:0:025d:0711:01: Failed to get private value: 5800000 => 2580 ret=-5
[ 114.386255] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 114.386303] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 read addr 8000 count 0
[ 114.386352] kernel: rt711-sdca sdw:0:025d:0711:01: Failed to get private value: 5800000 => 0040 ret=-5
[ 114.890210] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 114.890259] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 write addr a06f count 0
[ 114.890310] kernel: rt711-sdca sdw:0:025d:0711:01: Failed to set private value: 200006f <= 25c0 ret=-5
[ 115.394151] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 115.394198] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 write addr a04a count 0
[ 115.394247] kernel: rt711-sdca sdw:0:025d:0711:01: Failed to set private value: 200004a <= 201b ret=-5
[ 115.394300] kernel: snd_soc_rt711_sdca:rt711_sdca_calibration: rt711-sdca sdw:0:025d:0711:01: rt711_sdca_calibration calibration complete, ret=0
[ 115.898098] kernel: soundwire_intel soundwire_intel.link.0: SCP Msg trf timed out
[ 115.898147] kernel: soundwire sdw-master-0: trf on Slave 4 failed:-5 write addr 8300 count 0
To Reproduce
~/sof-test/test-case/check-suspend-resume.sh -l 20 -u
Reproduction Rate
No reproductions after 200+ iterations manual check. Very hard to reproduce it.
Environment
- Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
- Kernel: : f02bb90dd84e
- SOF: : d7da25fc2537
- Name of the topology file
- Topology: {sof-mtl-rt711-4ch.tplg}
- Name of the platform(s) on which the bug is observed.
- Platform: {MTL_RVP_SDW}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Intel Daily testsThis issue can be found in Intel internal daily testsThis issue can be found in Intel internal daily testsMTLApplies to Meteor Lake platform.Applies to Meteor Lake platform.P3Low-impact bugs or featuresLow-impact bugs or featuresSDWApplies to SoundWire bus for codec connectionApplies to SoundWire bus for codec connection
Activity
bardliao commentedon Mar 20, 2023
@keqiaozhang It is easily reproducible is you run
./sof_remove.sh; ./sof_insert.shtwice quickly. The reason is that we disable sdw irq when sof pci driver is removed, butrt711_sdca_io_initis still running. In other words, we disabled sdw irq when codec driver is still communicating to the codec. @plbossart FYIplbossart commentedon Mar 20, 2023
Could it be a codec bug @bardliao, where we remove the codec driver before the on-going commands are complete? Looks like a missing cancel_work_sync to me, no?
plbossart commentedon Mar 20, 2023
Actually with the PCI deferred workqueue-based probe I am not sure how we can deal with the insert-remove scenario. There is a built-in race condition where we can call the PCI .remove while the rest of the system is being initialized. And even when the PCI deferred probe completes, the system might still be initializating. This looks quite different to the initial suspend-resume reported in this issue @bardliao ?
bardliao commentedon Mar 21, 2023
@plbossart I think it is the same issue.
~/sof-test/test-case/check-suspend-resume.sh -l 20 -uwhere -u means toreloadunload audio modules. And from the logkernel: snd_sof_intel_hda_common:mtl_enable_sdw_irq: sof-audio-pci-intel-mtl 0000:00:1f.3: FW Poll Status: reg[0x114c]=0x0 successful--> This is to disable sdw irqThen
SCP Msg trf timed outhappens.I added some trace for debugging and below is the log that I reproduced with
~/sof-test/test-case/check-suspend-resume.sh -l 20 -uBesides, @keqiaozhang can't reproduce the issue after I removed
hda_sdw_int_enable(sdev, false);fromhda_sdw_exit.plbossart commentedon Mar 21, 2023
@bardliao sorry I don't see how suspend and resume can be similar to remove/insert cases. In the former case we go through suspend and the other remove. Different code paths.
And with suspend, I don't see how we can suspend at the manager level without having the codec device already suspended.
So no, not convinced at all they are the same issue, because the parent-child relationship adds a structure that should prevent this timeout from happening.
bardliao commentedon Mar 21, 2023
@plbossart The issue is not related to suspend/resume. It happened when CI run the " ~/sof-test/test-case/check-suspend-resume.sh -l 20 -u" command and failed at the module reload stage. It won't reproduce if we run " ~/sof-test/test-case/check-suspend-resume.sh -l 20". i.e. without the -u option.
plbossart commentedon Mar 21, 2023
Ah, thanks for the precision @bardliao
@keqiaozhang the description of the issue is invalid then. it should not be listed as a suspend issue....
I wasn't even aware this is a test we run. Why are we doing this? It's not like suspend-resume is easy in the first place.
I am completely lost of the purpose of this test.
We can do load/unload
We can do suspend/resume
Why do both?
@keqiaozhang @bardliao @marc-hb @greg-intel @fredoh9 any context on why we enabled this test?
marc-hb commentedon Mar 21, 2023
The
-uoption does NOT test both at the same time (which would admittedly never happen in the real world). The -u option unloads audio drivers BEFORE testing suspend/resume and reloads them AFTER. The -u option is meant to spot non-audio suspend/resume issues.plbossart commentedon Mar 21, 2023
I am still not clear as to why we have an issue with the suspend-resume -u, and not with the kmod unload-reload test.
Something is clearly fishy if the compound test finds something that is not found in a unit test.
bardliao commentedon Mar 22, 2023
@plbossart The context CI will reboot the DUT after some test cases are failed. The issue happened when the suspend/resume test is the first test case after DUT rebooted. So the scenario is to run
~/sof-test/test-case/check-suspend-resume.sh -l 20 -uright after boot. I was wondering why CI only reported the issue on MTL. And figured out that it takes a lot of time to wait for i915 init and it failed.So, CI actually run the test before sof probe complete, and it will unload modules right after sof probe completed.
marc-hb commentedon Mar 22, 2023
The i915 delay seems typical when it's not ready and we're forcing it anyway:
plbossart commentedon Mar 22, 2023
@bardliao but the point is why not run the kmod load/unload test right after reboot? I really don't get what we are doing here, there seems to be a CI fudge that is not clear or documented.
marc-hb commentedon Mar 22, 2023
Ideally we would reboot after every test, so every test would win the competition to be first after reboot and start from a clean state. However:
There's no ideal test sequence, only trade-offs.
You can never have too much validation - except for limited time and resources and diminishing returns/coverage.
plbossart commentedon May 16, 2023
I've lost the plot on this issue, is this still something we need to track @keqiaozhang @bardliao ?
keqiaozhang commentedon May 17, 2023
I think we can close this bug. thesofproject/sof-test#1033 is merged.