linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
@ 2022-09-26 11:02 Dmitry Baryshkov
       [not found] ` <Y1AGLPXWFOmjfdd0@hovoldconsulting.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-09-26 11:02 UTC (permalink / raw)
  To: Mark Rutland, Lorenzo Pieralisi, Ulf Hansson, Rafael J. Wysocki,
	Daniel Lezcano
  Cc: linux-arm-kernel, soc, linux-pm, Sudeep Holla

The function psci_pd_try_set_osi_mode() will print an error if enabling
OSI mode fails. To ease debugging PSCI issues print corresponding
message if switching to PC mode fails too.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
This is a replacement for [1], now moving the warning from
psci_set_osi_mode() callers to the function iself.

The patch is resent to include soc@kernel.org

[1] https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/

---
 drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
 drivers/firmware/psci/psci.c          | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
index 3db4fca1172b..821984947ed9 100644
--- a/drivers/cpuidle/cpuidle-psci-domain.c
+++ b/drivers/cpuidle/cpuidle-psci-domain.c
@@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
 		return false;
 
 	ret = psci_set_osi_mode(true);
-	if (ret) {
-		pr_warn("failed to enable OSI mode: %d\n", ret);
+	if (ret)
 		return false;
-	}
 
 	return true;
 }
diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index 9fdcb6bff403..42cae0ba10e2 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -164,6 +164,8 @@ int psci_set_osi_mode(bool enable)
 			PSCI_1_0_SUSPEND_MODE_PC;
 
 	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);
 	return psci_to_linux_errno(err);
 }
 
-- 
2.35.1


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

end of thread, other threads:[~2022-10-25 11:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 11:02 [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Dmitry Baryshkov
     [not found] ` <Y1AGLPXWFOmjfdd0@hovoldconsulting.com>
2022-10-19 14:36   ` Ulf Hansson
2022-10-19 15:02     ` Dmitry Baryshkov
     [not found]       ` <Y1DxfjExuzfKLWDs@hovoldconsulting.com>
2022-10-20  9:21         ` Ulf Hansson
2022-10-20 10:33         ` Dmitry Baryshkov
2022-10-25 11:41   ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).