public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] firmware/psci: demote suspend-mode warning to info level
@ 2022-10-26 13:54 Johan Hovold
  2022-10-27 10:59 ` Ulf Hansson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johan Hovold @ 2022-10-26 13:54 UTC (permalink / raw)
  To: Mark Rutland, Lorenzo Pieralisi
  Cc: Ulf Hansson, Dmitry Baryshkov, Sudeep Holla, Daniel Lezcano,
	linux-arm-kernel, linux-kernel, Johan Hovold

On some Qualcomm platforms, like SC8280XP, the attempt to set PC mode
during boot fails with PSCI_RET_DENIED and since commit 998fcd001feb
("firmware/psci: Print a warning if PSCI doesn't accept PC mode") this
is now logged at warning level:

	psci: failed to set PC mode: -3

As there is nothing users can do about the firmware behaving this way,
demote the warning to info level and clearly mark it as a firmware bug:

	psci: [Firmware Bug]: failed to set PC mode: -3

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/firmware/psci/psci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index e7bcfca4159f..f8fa32f0a130 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -165,7 +165,8 @@ int psci_set_osi_mode(bool enable)
 
 	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
 	if (err < 0)
-		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
+		pr_info(FW_BUG "failed to set %s mode: %d\n",
+				enable ? "OSI" : "PC", err);
 	return psci_to_linux_errno(err);
 }
 
-- 
2.37.3


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

* Re: [PATCH v2] firmware/psci: demote suspend-mode warning to info level
  2022-10-26 13:54 [PATCH v2] firmware/psci: demote suspend-mode warning to info level Johan Hovold
@ 2022-10-27 10:59 ` Ulf Hansson
  2022-10-27 12:15 ` Mark Rutland
  2022-11-30  6:53 ` Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2022-10-27 10:59 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Mark Rutland, Lorenzo Pieralisi, Dmitry Baryshkov, Sudeep Holla,
	Daniel Lezcano, linux-arm-kernel, linux-kernel

On Wed, 26 Oct 2022 at 15:57, Johan Hovold <johan+linaro@kernel.org> wrote:
>
> On some Qualcomm platforms, like SC8280XP, the attempt to set PC mode
> during boot fails with PSCI_RET_DENIED and since commit 998fcd001feb
> ("firmware/psci: Print a warning if PSCI doesn't accept PC mode") this
> is now logged at warning level:
>
>         psci: failed to set PC mode: -3
>
> As there is nothing users can do about the firmware behaving this way,
> demote the warning to info level and clearly mark it as a firmware bug:
>
>         psci: [Firmware Bug]: failed to set PC mode: -3
>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Using the info level seems like a good compromise to me! So,

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/firmware/psci/psci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index e7bcfca4159f..f8fa32f0a130 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
> @@ -165,7 +165,8 @@ int psci_set_osi_mode(bool enable)
>
>         err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
>         if (err < 0)
> -               pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
> +               pr_info(FW_BUG "failed to set %s mode: %d\n",
> +                               enable ? "OSI" : "PC", err);
>         return psci_to_linux_errno(err);
>  }
>
> --
> 2.37.3
>

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

* Re: [PATCH v2] firmware/psci: demote suspend-mode warning to info level
  2022-10-26 13:54 [PATCH v2] firmware/psci: demote suspend-mode warning to info level Johan Hovold
  2022-10-27 10:59 ` Ulf Hansson
@ 2022-10-27 12:15 ` Mark Rutland
  2022-10-27 12:58   ` Sudeep Holla
  2022-11-30  6:53 ` Johan Hovold
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Rutland @ 2022-10-27 12:15 UTC (permalink / raw)
  To: Johan Hovold, Sudeep Holla
  Cc: Lorenzo Pieralisi, Ulf Hansson, Dmitry Baryshkov, Daniel Lezcano,
	linux-arm-kernel, linux-kernel

On Wed, Oct 26, 2022 at 03:54:45PM +0200, Johan Hovold wrote:
> On some Qualcomm platforms, like SC8280XP, the attempt to set PC mode
> during boot fails with PSCI_RET_DENIED and since commit 998fcd001feb
> ("firmware/psci: Print a warning if PSCI doesn't accept PC mode") this
> is now logged at warning level:
> 
> 	psci: failed to set PC mode: -3
> 
> As there is nothing users can do about the firmware behaving this way,
> demote the warning to info level and clearly mark it as a firmware bug:
> 
> 	psci: [Firmware Bug]: failed to set PC mode: -3
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

On the assumption that we don't have any latent issues in this case, this looks
ok to me, so:

  Acked-by: Mark Rutland <mark.rutland@arm.com>

Sudeep, does this reasonable to you?

Are there any latent issues that mean we should keep this as a pr_warn()? 

Thanks,
Mark.

> ---
>  drivers/firmware/psci/psci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index e7bcfca4159f..f8fa32f0a130 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
> @@ -165,7 +165,8 @@ int psci_set_osi_mode(bool enable)
>  
>  	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
>  	if (err < 0)
> -		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
> +		pr_info(FW_BUG "failed to set %s mode: %d\n",
> +				enable ? "OSI" : "PC", err);
>  	return psci_to_linux_errno(err);
>  }
>  
> -- 
> 2.37.3
> 

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

* Re: [PATCH v2] firmware/psci: demote suspend-mode warning to info level
  2022-10-27 12:15 ` Mark Rutland
@ 2022-10-27 12:58   ` Sudeep Holla
  0 siblings, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2022-10-27 12:58 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Johan Hovold, Sudeep Holla, Lorenzo Pieralisi, Ulf Hansson,
	Dmitry Baryshkov, Daniel Lezcano, linux-arm-kernel, linux-kernel

On Thu, Oct 27, 2022 at 01:15:59PM +0100, Mark Rutland wrote:
> On Wed, Oct 26, 2022 at 03:54:45PM +0200, Johan Hovold wrote:
> > On some Qualcomm platforms, like SC8280XP, the attempt to set PC mode
> > during boot fails with PSCI_RET_DENIED and since commit 998fcd001feb
> > ("firmware/psci: Print a warning if PSCI doesn't accept PC mode") this
> > is now logged at warning level:
> > 
> > 	psci: failed to set PC mode: -3
> > 
> > As there is nothing users can do about the firmware behaving this way,
> > demote the warning to info level and clearly mark it as a firmware bug:
> > 
> > 	psci: [Firmware Bug]: failed to set PC mode: -3
> > 
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> 
> On the assumption that we don't have any latent issues in this case, this looks
> ok to me, so:
> 
>   Acked-by: Mark Rutland <mark.rutland@arm.com>
> 
> Sudeep, does this reasonable to you?
> 
> Are there any latent issues that mean we should keep this as a pr_warn()?

I am fine removing it as warning but making it debug may mask the issue
completely on the platforms that are using Linux itself for validation of
their PSCI firmware implementation. This sounds like a good compromise
instead of jumping from warning directly to debug. I just want to give a
chance for platforms noticing this and working on getting their firmware
fixed.

So for this version:

Acked-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

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

* Re: [PATCH v2] firmware/psci: demote suspend-mode warning to info level
  2022-10-26 13:54 [PATCH v2] firmware/psci: demote suspend-mode warning to info level Johan Hovold
  2022-10-27 10:59 ` Ulf Hansson
  2022-10-27 12:15 ` Mark Rutland
@ 2022-11-30  6:53 ` Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2022-11-30  6:53 UTC (permalink / raw)
  To: Mark Rutland, Lorenzo Pieralisi, Arnd Bergmann
  Cc: Ulf Hansson, Dmitry Baryshkov, Sudeep Holla, Daniel Lezcano,
	linux-arm-kernel, linux-kernel

On Wed, Oct 26, 2022 at 03:54:45PM +0200, Johan Hovold wrote:
> On some Qualcomm platforms, like SC8280XP, the attempt to set PC mode
> during boot fails with PSCI_RET_DENIED and since commit 998fcd001feb
> ("firmware/psci: Print a warning if PSCI doesn't accept PC mode") this
> is now logged at warning level:
> 
> 	psci: failed to set PC mode: -3
> 
> As there is nothing users can do about the firmware behaving this way,
> demote the warning to info level and clearly mark it as a firmware bug:
> 
> 	psci: [Firmware Bug]: failed to set PC mode: -3
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  drivers/firmware/psci/psci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index e7bcfca4159f..f8fa32f0a130 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
> @@ -165,7 +165,8 @@ int psci_set_osi_mode(bool enable)
>  
>  	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
>  	if (err < 0)
> -		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
> +		pr_info(FW_BUG "failed to set %s mode: %d\n",
> +				enable ? "OSI" : "PC", err);
>  	return psci_to_linux_errno(err);
>  }

Mark and Lorenzo, I noticed this one hasn't been picked up yet. Is that
something you will do or is Arnd supposed to take it?

Johan

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

end of thread, other threads:[~2022-11-30  6:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-26 13:54 [PATCH v2] firmware/psci: demote suspend-mode warning to info level Johan Hovold
2022-10-27 10:59 ` Ulf Hansson
2022-10-27 12:15 ` Mark Rutland
2022-10-27 12:58   ` Sudeep Holla
2022-11-30  6:53 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox