Skip to content

Commit 0bc3393

Browse files
adamkondraciukrlubos
authored andcommitted
[nrf fromlist] soc: nordic: nrf54h: disable IRQ before PM config
IRQs must be disabled before starting any procedures to prepare for low-power states. Upstream PR #: 79067 Signed-off-by: Adam Kondraciuk <[email protected]> (cherry picked from commit dab9c11)
1 parent b1b9e07 commit 0bc3393

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
@@ -188,15 +188,19 @@ static void s2ram_enter(void)
188188
void pm_state_set(enum pm_state state, uint8_t substate_id)
189189
{
190190
if (state == PM_STATE_SUSPEND_TO_IDLE) {
191+
__disable_irq();
191192
s2idle_enter(substate_id);
192193
/* Resume here. */
193194
s2idle_exit(substate_id);
195+
__enable_irq();
194196
}
195197
#if defined(CONFIG_PM_S2RAM)
196198
else if (state == PM_STATE_SUSPEND_TO_RAM) {
199+
__disable_irq();
197200
s2ram_enter();
198201
/* On resuming or error we return exactly *HERE* */
199202
s2ram_exit();
203+
__enable_irq();
200204
}
201205
#endif
202206
else {

0 commit comments

Comments
 (0)