-
Notifications
You must be signed in to change notification settings - Fork 7.3k
arch: arm: Fix Cortex-R power management interrupt handling #21758
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
arch: arm: Fix Cortex-R power management interrupt handling #21758
Conversation
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.
Looks fine with me, I've got two comments
- we're mixing CPU_CORTEX_M and ARMV..... Kconfig options here; could we stick to one variant of Kconfigs?
- would it be possible to explain inline why the change-processor-state instructions are not used for cotex-R?
The main reason I went with If you still think we should stick with the longer form, I will change it.
The This is necessary on the Cortex-M because the it supports interrupt nesting and hence interrupts are enabled by default when entering an ISR (this is automatically done by the NVIC core). As for the Cortex-R, the current arch port does not/cannot support interrupt nesting because context preservation is implemented in a quite incorrect/non-standard way (I am planning to address this in the near future). Note that, without interrupt nesting support, interrupts are (and must be) disabled inside an ISR; hence, it is not necessary to use a lock for checking and updating I will add |
The system power management handling code in the '_isr_wrapper' enables interrupts by executing the 'cpsie i' instruction, which causes a system crash on the Cortex-R devices because the Cortex-R arch port does not support nested interrupts at this time. This commit restricts the interrupt state manipulations in the system power management code to the Cortex-M arch, in order to prevent interrupt nesting on other AArch32 family archs (only Cortex-R for now). Signed-off-by: Stephanos Ioannidis <[email protected]>
2daff7c
to
59b9857
Compare
Thanks for the update @stephanosio , I think the fixme text looks fine
As discussed offline this is not accurate for ARMv7-M where CPS does more than IRQ_lock/unlock, which just modify the BASEPRI. |
p.s. I am planning to implement arch-level interrupt nesting support for the Cortex-R (and AArch32 Cortex-A) in the near future.