All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND][PATCH] firmware: psci: Fix return value from psci_system_suspend()
@ 2024-05-15  9:55 ` Sudeep Holla
  0 siblings, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2024-05-15  9:55 UTC (permalink / raw)
  To: arm, soc, linux-arm-kernel; +Cc: Sudeep Holla, Lorenzo Pieralisi, Mark Rutland

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: faf7ec4a92c0 ("drivers: firmware: psci: add system suspend support")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/psci/psci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Hi {arm-}soc team,

Please pick this up directly. This has slipped through the cracks as I
didn't follow up or cc-ed arm-soc team. Previously posted @[1].

Regards,
Sudeep

[1] https://lore.kernel.org/r/20231113153446.82684-1-sudeep.holla@arm.com

diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index d9629ff87861..2328ca58bba6 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -497,10 +497,12 @@ int psci_cpu_suspend_enter(u32 state)

 static int psci_system_suspend(unsigned long unused)
 {
+	int err;
 	phys_addr_t pa_cpu_resume = __pa_symbol(cpu_resume);

-	return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
+	err = invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
 			      pa_cpu_resume, 0, 0);
+	return psci_to_linux_errno(err);
 }

 static int psci_system_suspend_enter(suspend_state_t state)
--
2.43.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [RESEND][PATCH] firmware: psci: Fix return value from psci_system_suspend()
@ 2024-05-15  9:55 ` Sudeep Holla
  0 siblings, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2024-05-15  9:55 UTC (permalink / raw)
  To: arm, soc, linux-arm-kernel; +Cc: Sudeep Holla, Lorenzo Pieralisi, Mark Rutland

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: faf7ec4a92c0 ("drivers: firmware: psci: add system suspend support")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/psci/psci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Hi {arm-}soc team,

Please pick this up directly. This has slipped through the cracks as I
didn't follow up or cc-ed arm-soc team. Previously posted @[1].

Regards,
Sudeep

[1] https://lore.kernel.org/r/20231113153446.82684-1-sudeep.holla@arm.com

diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index d9629ff87861..2328ca58bba6 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -497,10 +497,12 @@ int psci_cpu_suspend_enter(u32 state)

 static int psci_system_suspend(unsigned long unused)
 {
+	int err;
 	phys_addr_t pa_cpu_resume = __pa_symbol(cpu_resume);

-	return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
+	err = invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
 			      pa_cpu_resume, 0, 0);
+	return psci_to_linux_errno(err);
 }

 static int psci_system_suspend_enter(suspend_state_t state)
--
2.43.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RESEND][PATCH] firmware: psci: Fix return value from psci_system_suspend()
  2024-05-15  9:55 ` Sudeep Holla
  (?)
@ 2024-06-20 21:34 ` patchwork-bot+linux-soc
  -1 siblings, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-soc @ 2024-06-20 21:34 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: soc

Hello:

This patch was applied to soc/soc.git (arm/fixes)
by Arnd Bergmann <arnd@arndb.de>:

On Wed, 15 May 2024 10:55:28 +0100 you wrote:
> 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().
> 
> [...]

Here is the summary with links:
  - [RESEND] firmware: psci: Fix return value from psci_system_suspend()
    https://git.kernel.org/soc/soc/c/e7c3696d4692

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-20 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15  9:55 [RESEND][PATCH] firmware: psci: Fix return value from psci_system_suspend() Sudeep Holla
2024-05-15  9:55 ` Sudeep Holla
2024-06-20 21:34 ` patchwork-bot+linux-soc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.