Skip to content

Commit 3cda675

Browse files
adamkondraciukjukkar
authored andcommitted
[nrf fromtree] soc: nordic: nrf54h: disable IRQ before PM config
IRQs must be disabled before starting any procedures to prepare for low-power states. Signed-off-by: Adam Kondraciuk <[email protected]> (cherry picked from commit be1f405) (cherry picked from commit 9548301)
1 parent a83331b commit 3cda675

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

soc/nordic/nrf54h/pm_s2ram.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,15 @@ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off)
111111
{
112112
int ret;
113113

114-
__disable_irq();
115114
nvic_suspend(&backup_data.nvic_context);
116115
mpu_suspend(&backup_data.mpu_context);
117116
ret = arch_pm_s2ram_suspend(system_off);
118117
if (ret < 0) {
119-
__enable_irq();
120118
return ret;
121119
}
122120

123121
mpu_resume(&backup_data.mpu_context);
124122
nvic_resume(&backup_data.nvic_context);
125-
__enable_irq();
126123

127124
return ret;
128125
}

soc/nordic/nrf54h/power.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,19 @@ static void s2ram_enter(void)
174174
void pm_state_set(enum pm_state state, uint8_t substate_id)
175175
{
176176
if (state == PM_STATE_SUSPEND_TO_IDLE) {
177+
__disable_irq();
177178
s2idle_enter(substate_id);
178179
/* Resume here. */
179180
s2idle_exit(substate_id);
181+
__enable_irq();
180182
}
181183
#if defined(CONFIG_PM_S2RAM)
182184
else if (state == PM_STATE_SUSPEND_TO_RAM) {
185+
__disable_irq();
183186
s2ram_enter();
184187
/* On resuming or error we return exactly *HERE* */
185188
s2ram_exit();
189+
__enable_irq();
186190
}
187191
#endif
188192
else {

0 commit comments

Comments
 (0)