linux icon indicating copy to clipboard operation
linux copied to clipboard

Fix DSP suspend after a crash

Open ranj063 opened this issue 3 years ago • 10 comments

Fixes https://github.com/thesofproject/linux/issues/4023

ranj063 avatar Nov 16 '22 20:11 ranj063

@cujomalainey @andyross @sathya-nujella

jairaj-arava avatar Nov 16 '22 21:11 jairaj-arava

Looks like a great fix, just trying to understand how it applies in our 5.4 and 5.10 kernels as those don't have the concept of the panic state yet. @cujomalainey [ASoC: SOF: pm: Always tear down pipelines before DSP suspend] This is applicable only to 5.15 kernel since soon after resume we see playback is not happening since the pieplines are not tared down before the system suspends. On 5.10 we don't see this issue. Whereas [ASoC: SOF: pm: Set target state earlier] is applicable to both 5.10 and 5.15.

jairaj-arava avatar Nov 16 '22 21:11 jairaj-arava

Whereas [ASoC: SOF: pm: Set target state earlier] is applicable to both 5.10 and 5.15.

Hmm, in 5.10 I still don't see how that is true. In 5.10 fw_state is either SOF_FW_BOOT_NOT_STARTED or SOF_FW_BOOT_COMPLETE by the time FW load is complete. Suspend has an early bail for NOT_STARTED and the bug requires it to be not in the BOOT_COMPLETE state.

cujomalainey avatar Nov 16 '22 22:11 cujomalainey

Whereas [ASoC: SOF: pm: Set target state earlier] is applicable to both 5.10 and 5.15.

Hmm, in 5.10 I still don't see how that is true. In 5.10 fw_state is either SOF_FW_BOOT_NOT_STARTED or SOF_FW_BOOT_COMPLETE by the time FW load is complete. Suspend has an early bail for NOT_STARTED and the bug requires it to be not in the BOOT_COMPLETE state.

I do not think the fix applies for the kernels that do not change the FW state after a crash. But wouldnt hurt to initialize the target state at the beginning even in those cases.

ranj063 avatar Nov 16 '22 22:11 ranj063

Whereas [ASoC: SOF: pm: Set target state earlier] is applicable to both 5.10 and 5.15.

Hmm, in 5.10 I still don't see how that is true. In 5.10 fw_state is either SOF_FW_BOOT_NOT_STARTED or SOF_FW_BOOT_COMPLETE by the time FW load is complete. Suspend has an early bail for NOT_STARTED and the bug requires it to be not in the BOOT_COMPLETE state.

I do not think the fix applies for the kernels that do not change the FW state after a crash. But wouldnt hurt to initialize the target state at the beginning even in those cases.

That I agree with, but it unfortunately means we likely don't have our smoking gun

cujomalainey avatar Nov 16 '22 23:11 cujomalainey

looks good but there's no information on the actual issue this PR is supposed to fix. The commit message and comment hint at a Chrome problem? Also shouldn't there be a Fixes: tag for both commits?

@plbossart bug report coming soon. @jairaj-arava please link the bug to this PR once you have posted it. Thanks!

ranj063 avatar Nov 17 '22 01:11 ranj063

looks good but there's no information on the actual issue this PR is supposed to fix. The commit message and comment hint at a Chrome problem? Also shouldn't there be a Fixes: tag for both commits?

@plbossart I im not sure about a fixes tag. Unfortunately this part of the code hasnt changed for a long time but what changed was the addition of the fw state machine and the addition of the state change during a DSP panic which basically makes the check if (fw_state != BOOT_COMPLETE) not true

ranj063 avatar Nov 17 '22 16:11 ranj063

Fine @ranj063, I'll let you decide if this needs to be merged now or later.

plbossart avatar Nov 17 '22 16:11 plbossart

Fine @ranj063, I'll let you decide if this needs to be merged now or later.

@plbossart should I update the patches with "Link:,..."?

ranj063 avatar Nov 17 '22 17:11 ranj063

Fine @ranj063, I'll let you decide if this needs to be merged now or later.

@plbossart should I update the patches with "Link:,..."?

it's probably ok without the link - or it can be added when upstreaming.

plbossart avatar Nov 17 '22 19:11 plbossart