Repository navigation
Conversation
On some CherryTrail devices, the DSP sometimes fails to boot during load/unload tests, likely due to dependencies with the platform firmware or timing issues. Re-loading the firmware twice makes the problems go away. This is far from perfect but it's nearly impossible to solve the issue cleanly on 5-yr old devices. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
if the FW_READY mechanism fails, the platform may allow for a boot retry. In that case, debugfs complains about duplicate entries. Move the creation after boot success. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The existing code identifies unexpected IPC messages by testing if sdev->msg is NULL. That pointer is initialized but never reset to NULL, so the warning will only be thrown before the first IPC transfer happens. Fix by using the ipc_complete boolean used in all other places. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use the relevant register names to avoid confusion and use the correct bit offsets to avoid showing bad debug information. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
s/regsisters/registers Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The Atom/sst driver configures all Tensilica-initiated traffic to be snooped. FIXME: Not sure if/why this this needed? Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
I tried 20 times module reload test, but I can't reproduce this issue with or without this PR on CML-H laptop |
lyakh
left a comment
There was a problem hiding this comment.
seem to be no new CI failures, apart from those, also frequently present in other PRs
| snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_CSR, | ||
| SHIM_BYT_CSR_STALL, 0x0); | ||
| SHIM_BYT_CSR_XT_SNOOP | SHIM_BYT_CSR_STALL, | ||
| SHIM_BYT_CSR_XT_SNOOP); |
There was a problem hiding this comment.
does this enable PCIe snooping of the DSP traffic? And without it it's disabled? I'm not an expert in that but in general that seems like a good thing to maintain cache coherency? I don't know why it would be possible to disable it, but maybe my guess is wrong and it's something different entirely.
There was a problem hiding this comment.
I think it's wrong, will remove this.
There was a problem hiding this comment.
would that leave snooping disabled? Or does that flag disable snooping when set?
WIP patch that works on Windows devices but not on Chromebook. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
Update known to fail on Cyan but want to check PCI base on MinnowBoard. |
yes, it's only trying to fix issues on the Cyan Chromebook |
| /* when the DSP boots but FW_READY fails, tentatively retry */ | ||
| if (ret == -EIO && ++tries < sof_ops(sdev)->firmware_boot_retries) { | ||
| dev_warn(sdev->dev, "retrying DSP boot, iteration %d\n", tries); | ||
| goto fw_load_retry; |
There was a problem hiding this comment.
don't we have to reset the sdev->fw_state to SOF_FW_BOOT_PREPARE when retrying? You could also extract snd_sof_load_firmware() and snd_sof_run_firmware() into a separate function and call it in a loop, thus avoiding a goto, but I'll probably do that anyway when my VirtIO patches reach that state... since they're touching this code too.
| /* errors are only due to memory allocation, not debugfs */ | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: snd_sof_debugfs_buf_item failed\n"); | ||
| return ret; |
There was a problem hiding this comment.
This also changes the error processing semantics: before this patch if debugfs file creation failed, we wouldn't boot the firmware, now the firmware is already running but we still fail probing... Maybe make this a soft failure now?
There was a problem hiding this comment.
@plbossart I think we shoudl keep the debugfs creationg before attempting to boot. The sdev->fw_version member is populated when the FW_READY IPC message is received and if you move this to after boot is complete, I think this would never get populated
There was a problem hiding this comment.
@ranj063 this was to work around the debugfs error warnings that the item is already created if you try and reboot multiple times when FW_READY never happens.
There was a problem hiding this comment.
@plbossart ahh I see. Then I think this should be moved to ipc.c where we handle the FW_READY IPC. That would for sure indicate that the FW boot is complete and so its good to create the debugfs entry and copy the fw_version from the IPC reply.
There was a problem hiding this comment.
Well we don't want to have a memory allocation failure in ipc.c, we should maybe create this earlier instead of in the firmware_run function.
There was a problem hiding this comment.
then maybe we should just create this during dbg init?
| snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_CSR, | ||
| SHIM_BYT_CSR_STALL, 0x0); | ||
| SHIM_BYT_CSR_XT_SNOOP | SHIM_BYT_CSR_STALL, | ||
| SHIM_BYT_CSR_XT_SNOOP); |
There was a problem hiding this comment.
would that leave snooping disabled? Or does that flag disable snooping when set?
|
|
||
| pmc_status = snd_sof_dsp_read(sdev, BYT_PCI_BAR, PCI_PMCS); | ||
| if (pmc_status & 0x3) { | ||
| dev_err(sdev->dev, "error: PMC status does not indicated D0 state %x\n", |
|
Additional investigations show this is a Coreboot issue with BAR1 not set. Will be checking once a coreboot image is available. |
This PR addresses issues that were missed early by CI and me/myself/ and I.
Somehow the module load/unload test fails randomly about 20-30% of the time. There's no obvious root cause, the FW_READY IPC is not provided and the boot times out. Adding a retry loop fixes the issue reliably.
it's quite ugly but aligned with other issues encountered on other platforms, so not something to be completely ashamed of - or just as bad as other platforms.
dmesg log excerpt
While I was at it, fix a number of IPC-related issues to clean-up the code and debug traces.