Skip to content
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

xtensa: allow arch-specific arch_spin_relax() with more NOPs #60601

Merged

Conversation

dcpleung
Copy link
Member

This adds a Kconfig to introduce the Xtensa specific arch_spin_relax() which can do more NOPs. Some Xtensa SoCs may need more NOPs after failure to lock a spinlock, especially under SMP. This gives the bus extra time to propagate the RCW transactions among CPUs.

This adds a Kconfig to introduce the Xtensa specific
arch_spin_relax() which can do more NOPs. Some Xtensa SoCs
may need more NOPs after failure to lock a spinlock,
especially under SMP. This gives the bus extra time to
propagate the RCW transactions among CPUs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
@dcpleung dcpleung marked this pull request as ready for review July 19, 2023 21:34
@zephyrbot zephyrbot added the area: Xtensa Xtensa Architecture label Jul 19, 2023
Copy link
Contributor

@andyross andyross left a comment

Choose a reason for hiding this comment

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

Looks very reasonable. I never found a reference, but does Cadence have any guidance or a whitepaper or something on the best way to do this?

@dcpleung
Copy link
Member Author

Not that I know of. Stuff magically start working after introduction of arch_spin_relax() (as seen in thesofproject/sof#7705), and better with more NOPs. Here is my attempt to make it generic so how many NOPs can be tuned on each board.

@fabiobaltieri fabiobaltieri merged commit a458d04 into zephyrproject-rtos:main Jul 20, 2023
19 checks passed
@dcpleung dcpleung deleted the xtensa/more_spin_relax_nops branch July 20, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants