Skip to content

Commit c9223b6

Browse files
Marc Zyngierwilldeacon
authored andcommitted
PSCI: Use cpuidle context helpers in psci_cpu_suspend_enter()
The PSCI CPU suspend code isn't aware of the PMR vs DAIF game, resulting in a system that locks up if entering CPU suspend with GICv3 pNMI enabled. To save the day, teach the suspend code about our new cpuidle context helpers, which will do everything that's required just like the usual WFI cpuidle code. This fixes my Altra system, which would otherwise lock-up at boot time when booted with irqchip.gicv3_pseudo_nmi=1. Tested-by: Valentin Schneider <valentin.schneider@arm.com> Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Link: https://lore.kernel.org/r/20210615111227.2454465-4-maz@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent d4dc102 commit c9223b6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/firmware/psci/psci.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,15 @@ int psci_cpu_suspend_enter(u32 state)
335335
{
336336
int ret;
337337

338-
if (!psci_power_state_loses_context(state))
338+
if (!psci_power_state_loses_context(state)) {
339+
struct arm_cpuidle_irq_context context;
340+
341+
arm_cpuidle_save_irq_context(&context);
339342
ret = psci_ops.cpu_suspend(state, 0);
340-
else
343+
arm_cpuidle_restore_irq_context(&context);
344+
} else {
341345
ret = cpu_suspend(state, psci_suspend_finisher);
346+
}
342347

343348
return ret;
344349
}

0 commit comments

Comments
 (0)