Repository navigation
put audio to D3 if no d0i3 compatible stream opened. #1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f576241
ASoC: SOF: PM: add check before setting d0_substate
keyonjie 537a5d7
ASoC: SOF: add helper to check if we should enter d0i3 suspend
keyonjie 8765183
ASoC: SOF: PM: only suspend to D0I3 when needed
keyonjie d7ea746
ASoC: SOF: PM: add state machine to comments
keyonjie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keyonjie in my interpretation there are only 3 states for the DSP (D0, D0i3 and D3) So it is a bit confusing when your say D3 runtime-suspended and D3 suspended. Its not quite clear what it really means.
I made a simpler diagram. Let me know if you cant understand my handwriting. I may have missed something but I think this shows the transitions between the DSP states better.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above diagram only applies if the platform supports D0i3. The other thing is this diagram is intel specific. So needs to be moved there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, basically, I think your diagram is good to describe to DSP state transitions, except that it doesn't include:
Then should we draw another diagram to describe the internal transition for '2' and '1'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew I missed something and yes the runtime PM case is important. Let me add it and send you a new diagram in a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree with Ranjani, there is no difference between runtime_suspended D3 and system_suspended D3. it's D3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
um, it depends on how do you define the DSP state, e.g. we may put DSP to lower power state D0i3 when the system is in S0ix suspended, comparing with the S0 D0i3, so the flags in PM_GATE IPC will be different for them.
I am fine to use the simpler diagram here to make it easier for understanding, but we need to keep in mind that we still have difference scenarios(or called sub-state) inside both the D3 and D0i3 state, when we are in coding of the detail logic handling there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keyonjie Why would it be different in S0? Why cant you put the DSP in the same lower power D0i3 in S0?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, per my observation, in S0 D0i3, access to memory windows is possible, and we are planning to keep DMA trace active in this state for debug purpose, but when the system is entering S0ix, everything is changed, I don't have enough knowledge to explain how PMC will handling to the audio domain on S0ix entering, but I am quite sure the behavior of the Audio DSP in this S0ix D0i3 has difference with the one in S0 D0i3.
And, from the system point of view, we might need more normal interaction between FW & host in S0 D0i3 without putting the DSP back to D0, which is impossible in S0ix D0i3. When we are in S0ix D0i3, the only interaction between DSP and host is that the FW will send an IPC to wake the host up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you have different definitions of D0i3....
You should have one well defined behavior. If you have multiple behaviors, then you are not validating the same things.
I think the memory windows and DMA should only be allowed in D0i3_streaming. @mmaka1 and @lbetlej mentioned this state when we started this, and maybe it's time to formally recognize the difference between usages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, that is a major scenario of S0 D0i3, I think.