Skip to content

Commit e0868d9

Browse files
[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]>
1 parent d66c77a commit e0868d9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

soc/nordic/nrf54h/pm_s2ram.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,16 @@ 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();
118+
/* On resuming or error we return exactly *HERE* */
120119
return ret;
121120
}
122121

123122
mpu_resume(&backup_data.mpu_context);
124123
nvic_resume(&backup_data.nvic_context);
125-
__enable_irq();
126124

127125
return ret;
128126
}

soc/nordic/nrf54h/power.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,16 @@ 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);
194195
}
195196
#if defined(CONFIG_PM_S2RAM)
196197
else if (state == PM_STATE_SUSPEND_TO_RAM) {
198+
__disable_irq();
197199
s2ram_enter();
198-
/* On resuming or error we return exactly *HERE* */
200+
/* Resume here. */
199201
s2ram_exit();
200202
}
201203
#endif
@@ -206,5 +208,5 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
206208

207209
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
208210
{
209-
irq_unlock(0);
211+
__enable_irq();
210212
}

0 commit comments

Comments
 (0)