Skip to contentSkip to conversation

firmware/psci: demote suspend-mode warning to info level

PATCH Superseded Johan Hovold 5 participants 5 messages Oct 26, 2022 – Nov 30, 2022 Power state coordination interface (psci)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 firmware/psci: demote suspend-mode warning to info level

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

---
 drivers/firmware/psci/psci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/firmware/psci/psci.c +2 -1
index e7bcfca4159f..f8fa32f0a130 100644
@@ -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);
 }
 
Signature · 1 line
2.37.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · 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:

Quoted 8 lines

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

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

Kind regards
Uffe

Quoted 21 lines
---
 drivers/firmware/psci/psci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/firmware/psci/psci.c +2 -2
index e7bcfca4159f..f8fa32f0a130 100644
@@ -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

maintainer Acked-by on v2 1/1
#2 lore raw
In reply to Johan Hovold
Quoted 5 lines · 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:

Quoted 8 lines

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

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

Sudeep, does this reasonable to you?

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

Thanks,
Mark.

Quoted 21 lines
---
 drivers/firmware/psci/psci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/firmware/psci/psci.c +2 -1
index e7bcfca4159f..f8fa32f0a130 100644
@@ -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);
 }
 
Signature · 1 line
2.37.3
Acked-by
#3 lore raw
Quoted 15 lines · Mark Rutland
Quoted 5 lines · 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:

Quoted 8 lines

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

Quoted 8 lines

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

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:

--
Regards,
Sudeep

#4 lore raw
In reply to Johan Hovold
Quoted 22 lines · 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

---
 drivers/firmware/psci/psci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/firmware/psci/psci.c +0 -0
index e7bcfca4159f..f8fa32f0a130 100644

drivers/firmware/psci/psci.c int psci_set_osi_mode(bool enable) · line 171

Quoted 8 lines
drivers/firmware/psci/psci.c +2 -1
@@ -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