Skip to content

platform: ace: notifying about idle thread readiness #7174

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

Conversation

tmleman
Copy link
Contributor

@tmleman tmleman commented Feb 25, 2023

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:

@tmleman tmleman changed the title platform: ace: notifying about idle thread readiness [DNM] platform: ace: notifying about idle thread readiness Feb 26, 2023
@tmleman tmleman marked this pull request as ready for review February 26, 2023 22:14
@sys-pt1s
Copy link

sys-pt1s commented Apr 6, 2023

Can one of the admins verify this patch?

@tmleman tmleman force-pushed the topic/upstream/pr/ace/pm/secondary_core_d3 branch from 305785a to affa6aa Compare April 6, 2023 12:42
@lgirdwood
Copy link
Member

@tmleman any update ?

@tmleman
Copy link
Contributor Author

tmleman commented Apr 25, 2023

any update ?

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

tmleman added 2 commits April 28, 2023 11:17
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 tmleman force-pushed the topic/upstream/pr/ace/pm/secondary_core_d3 branch from affa6aa to 69c559f Compare April 28, 2023 09:33
@tmleman tmleman changed the title [DNM] platform: ace: notifying about idle thread readiness platform: ace: notifying about idle thread readiness Apr 28, 2023
Copy link
Collaborator

@kv2019i kv2019i left a comment

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.

* and the idle thread stack.
*/
if (pm_state_next_get(id)->state == PM_STATE_ACTIVE)
z_init_cpu(id);
Copy link
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
Contributor Author

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
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 kv2019i May 8, 2023 13:05
Copy link
Collaborator

@kv2019i kv2019i left a comment

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
Contributor Author

tmleman commented May 11, 2023

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

@kv2019i
Copy link
Collaborator

kv2019i commented May 11, 2023

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:main May 11, 2023
@tmleman tmleman deleted the topic/upstream/pr/ace/pm/secondary_core_d3 branch May 23, 2024 11:18
Sign up for free to 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