Skip to content

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions arch/arm/core/aarch32/isr_wrapper.S
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ SECTION_FUNC(TEXT, _isr_wrapper)
* state is not interrupted. In each case, z_sys_power_save_idle_exit
* is called with interrupts disabled.
*/

/*
* FIXME: Remove the Cortex-M conditional compilation checks for `cpsid i`
* and `cpsie i` after the Cortex-R port is updated to support
* interrupt nesting. For more details, refer to the issue #21758.
*/
#if defined(CONFIG_CPU_CORTEX_M)
cpsid i /* PRIMASK = 1 */
#endif

/* is this a wakeup from idle ? */
ldr r2, =_kernel
Expand Down Expand Up @@ -110,9 +118,12 @@ _idle_state_cleared:
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */

#if defined(CONFIG_CPU_CORTEX_M)
cpsie i /* re-enable interrupts (PRIMASK = 0) */
#endif

#endif /* CONFIG_SYS_POWER_MANAGEMENT */

#if defined(CONFIG_CPU_CORTEX_M)
mrs r0, IPSR /* get exception number */
#endif
Expand Down