Skip to content

Commit e7c3696

Browse files
sudeep-hollaarndb
authored andcommitted
firmware: psci: Fix return value from psci_system_suspend()
Currently we return the value from invoke_psci_fn() directly as return value from psci_system_suspend(). It is wrong to send the PSCI interface return value directly. psci_to_linux_errno() provide the mapping from PSCI return value to the one that can be returned to the callers within the kernel. Use psci_to_linux_errno() to convert and return the correct value from psci_system_suspend(). Fixes: faf7ec4 ("drivers: firmware: psci: add system suspend support") Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Link: https://lore.kernel.org/r/20240515095528.1949992-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 8de8165 commit e7c3696

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/firmware/psci/psci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,12 @@ int psci_cpu_suspend_enter(u32 state)
497497

498498
static int psci_system_suspend(unsigned long unused)
499499
{
500+
int err;
500501
phys_addr_t pa_cpu_resume = __pa_symbol(cpu_resume);
501502

502-
return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
503+
err = invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
503504
pa_cpu_resume, 0, 0);
505+
return psci_to_linux_errno(err);
504506
}
505507

506508
static int psci_system_suspend_enter(suspend_state_t state)

0 commit comments

Comments
 (0)