zephyr: fix race in secondary core power-up#5455
Merged
lgirdwood merged 2 commits intoMar 1, 2022
Merged
Conversation
z_wrapper_cpu_enable_secondary_core() may be called repeatedly on a core that is already running. Add a check to ensure we do not try to restart a core that is already running. Also add a check for ready_flag as done in upstream Zephyr kernel/smp.c to ensure z_wrapper_cpu_enable_secondary_core() does not return until the target core has finished its startup and arch_cpu_active() returns true. BugLink: thesofproject#5446 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Use the new interface to initialize non-primary cores before
enabling them with arch_start_cpu(). This interface is not
available in Zephyr 3.0.0, but is mandatory in later release.
Depends on Zephyr commit 2b210cb3db05 ("kernel: Refactor SMP cpu
initialization a bit").
BugLink: thesofproject#5456
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
lgirdwood
approved these changes
Mar 1, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
z_wrapper_cpu_enable_secondary_core() may be called
repeatedly on a core that is already running. Add a check
to ensure we do not try to restart a core that is already
running.
Also add a check for ready_flag as done in upstream Zephyr
kernel/smp.c to ensure z_wrapper_cpu_enable_secondary_core()
does not return until the target core has finished its
startup and arch_cpu_active() returns true.
BugLink: #5446
Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com