Skip to content

platform: ace: notifying about idle thread readiness - #7174

Merged
kv2019i merged 2 commits into
thesofproject:mainfrom
tmleman:topic/upstream/pr/ace/pm/secondary_core_d3
May 11, 2023
Merged

platform: ace: notifying about idle thread readiness#7174
kv2019i merged 2 commits into
thesofproject:mainfrom
tmleman:topic/upstream/pr/ace/pm/secondary_core_d3

Conversation

@tmleman

@tmlemantmleman commented Feb 25, 2023

Copy link
Copy Markdown
Contributor

Informing the primary core that the Idle thread on secondary core is ready. During the D3 exit flow thread is not initialize again, but restored from previously saved context.

Requires:

@tmlemantmleman changed the title platform: ace: notifying about idle thread readiness[DNM] platform: ace: notifying about idle thread readinessFeb 26, 2023
@tmleman
tmleman marked this pull request as ready for review February 26, 2023 22:14
Comment threadsrc/platform/intel/ace/platform.c Outdated
Comment threadzephyr/lib/cpu.c Outdated
Comment threadsrc/platform/intel/ace/platform.c Outdated
@sys-pt1s

Copy link
Copy Markdown

Can one of the admins verify this patch?

Comment threadzephyr/lib/cpu.c Outdated
@tmleman
tmlemanforce-pushed the topic/upstream/pr/ace/pm/secondary_core_d3 branch from 305785a to affa6aaCompareApril 6, 2023 12:42
@lgirdwood

Copy link
Copy Markdown
Member

@tmleman any update ?

@tmleman

Copy link
Copy Markdown
ContributorAuthor

any update ?

@lgirdwood I'm still waiting for the merge on the zephyr side

Idle thread should be initialize only when core it booting for the first
time. Doing this again would overwrite the kernel structs and the idle
thread stack.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Informing the primary core that the Idle thread on secondary core is
ready. During the D3 exit flow thread is not initialize again, but
restored from previously saved context.
This patch includes also zephyr version update to aba3b12e31 (total 15
commits). Changes related to intel_adsp contain refactor and fixes for
ACE secondary cores power flows.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
@tmleman
tmlemanforce-pushed the topic/upstream/pr/ace/pm/secondary_core_d3 branch from affa6aa to 69c559fCompareApril 28, 2023 09:33
@tmlemantmleman changed the title [DNM] platform: ace: notifying about idle thread readinessplatform: ace: notifying about idle thread readinessApr 28, 2023

@kv2019ikv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see in second commit this is related to state-save. This should be somehow conditional on the feature being used, given the generic code is used for all platform/vendors.

Comment threadzephyr/lib/cpu.c
* and the idle thread stack.
*/
if (pm_state_next_get(id)->state == PM_STATE_ACTIVE)
z_init_cpu(id);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this is an open-coded of z_smp_start_cpu() (see comment above), I don't fully understand why we have a different implementation here, and if this is correct, why this is not needed in the Zephyr kernel/smp.c version. Wouldn't the same problem be there? Or is this specific to a configuration where state is saved to persistant memory? If yes, this would need to be ifdef'ed out so this applies only to applicable platforms.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how zephyr is handling it but right now it's not working properly. After secondary core exits D3 it will repeat the path that led him to this state. Power will not be shut off so eventually it will return to the Idle state but this is not correct behavior. Maybe zephyr doesn't support situation in which each core can be turned off and on multiple times.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nashif@teburd@dcpleung@andyross ^^ trying to understand why z_smp_start_cpu() does not need this?

@tmleman
tmleman requested a review from kv2019iMay 8, 2023 13:05
@kv2019ikv2019i mentioned this pull request May 11, 2023

@kv2019ikv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to file a ticket to follow-up the change, but otherwise PR can proceed (and is potentially a blocker to update Zephyr baseline now).

@tmleman

Copy link
Copy Markdown
ContributorAuthor

@kv2019i I have submitted requested issue #7593. I think we can proceed with merge.

@kv2019i

Copy link
Copy Markdown
Collaborator

Usual PM fail in https://sof-ci.01.org/sofpr/PR7174/build6662/devicetest/index.html (but passes on at least one device) and https://sof-ci.01.org/sofpr/PR7174/build6663/devicetest/index.html has one fail on system PM.

Proceeding with the fix. Thanks @tmleman for filing the issue.

@kv2019i
kv2019i merged commit 93947f9 into thesofproject:mainMay 11, 2023
@tmleman
tmleman deleted the topic/upstream/pr/ace/pm/secondary_core_d3 branch May 23, 2024 11:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@tmleman@sys-pt1s@lgirdwood@kv2019i@paulstelian97@aborisovich@marcinszkudlinski