From: Ulf Hansson <ulf.hansson@linaro.org> To: Johan Hovold <johan@kernel.org> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Sudeep Holla <sudeep.holla@arm.com>, Arnd Bergmann <arnd@arndb.de>, Mark Rutland <mark.rutland@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, linux-arm-kernel@lists.infradead.org, soc@kernel.org, linux-pm@vger.kernel.org Subject: Re: [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Date: Wed, 19 Oct 2022 16:36:56 +0200 [thread overview] Message-ID: <CAPDyKFr9MraGWz7hbHyGtFsk7V2_GBUqvWBG5yM40zV6utwXOQ@mail.gmail.com> (raw) In-Reply-To: <Y1AGLPXWFOmjfdd0@hovoldconsulting.com> On Wed, 19 Oct 2022 at 16:14, Johan Hovold <johan@kernel.org> wrote: > > On Mon, Sep 26, 2022 at 02:02:49PM +0300, Dmitry Baryshkov wrote: > > 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); > > } > > When booting 6.1-rc1 I now see: > > [ 0.000000] psci: OSI mode supported. > [ 0.000000] psci: failed to set PC mode: -3 > > on every boot with sc8280xp, while later enabling OSI mode still works: > > [ 0.227358] CPUidle PSCI: psci_pd_try_set_osi_mode - success > [ 0.227599] CPUidle PSCI: Initialized CPU PM domain topology > > Judging from Sudeep's comment on v1: > > The platform must boot in PC mode, so even if it fails we ignore > so not sure if the logging is of much help here IMO. > > perhaps logging this as an error is not a good idea? I think it's useful to get information that the FW doesn't fully conform to the spec (it should support PC mode), but that doesn't really mean that it can't work. To me, it sounds like we should move the logging to the debug level!? > > Johan Br Uffe
WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org> To: Johan Hovold <johan@kernel.org> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Sudeep Holla <sudeep.holla@arm.com>, Arnd Bergmann <arnd@arndb.de>, Mark Rutland <mark.rutland@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, linux-arm-kernel@lists.infradead.org, soc@kernel.org, linux-pm@vger.kernel.org Subject: Re: [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Date: Wed, 19 Oct 2022 16:36:56 +0200 [thread overview] Message-ID: <CAPDyKFr9MraGWz7hbHyGtFsk7V2_GBUqvWBG5yM40zV6utwXOQ@mail.gmail.com> (raw) In-Reply-To: <Y1AGLPXWFOmjfdd0@hovoldconsulting.com> On Wed, 19 Oct 2022 at 16:14, Johan Hovold <johan@kernel.org> wrote: > > On Mon, Sep 26, 2022 at 02:02:49PM +0300, Dmitry Baryshkov wrote: > > 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); > > } > > When booting 6.1-rc1 I now see: > > [ 0.000000] psci: OSI mode supported. > [ 0.000000] psci: failed to set PC mode: -3 > > on every boot with sc8280xp, while later enabling OSI mode still works: > > [ 0.227358] CPUidle PSCI: psci_pd_try_set_osi_mode - success > [ 0.227599] CPUidle PSCI: Initialized CPU PM domain topology > > Judging from Sudeep's comment on v1: > > The platform must boot in PC mode, so even if it fails we ignore > so not sure if the logging is of much help here IMO. > > perhaps logging this as an error is not a good idea? I think it's useful to get information that the FW doesn't fully conform to the spec (it should support PC mode), but that doesn't really mean that it can't work. To me, it sounds like we should move the logging to the debug level!? > > Johan Br Uffe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-10-19 14:37 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-26 11:02 [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Dmitry Baryshkov 2022-09-26 11:02 ` Dmitry Baryshkov 2022-09-28 21:00 ` patchwork-bot+linux-soc 2022-10-19 14:14 ` Johan Hovold 2022-10-19 14:14 ` Johan Hovold 2022-10-19 14:36 ` Ulf Hansson [this message] 2022-10-19 14:36 ` Ulf Hansson 2022-10-19 15:02 ` Dmitry Baryshkov 2022-10-19 15:02 ` Dmitry Baryshkov 2022-10-20 6:58 ` Johan Hovold 2022-10-20 6:58 ` Johan Hovold 2022-10-20 9:21 ` Ulf Hansson 2022-10-20 9:21 ` Ulf Hansson 2022-10-20 10:33 ` Dmitry Baryshkov 2022-10-20 10:33 ` Dmitry Baryshkov 2022-10-25 11:41 ` Sudeep Holla 2022-10-25 11:41 ` Sudeep Holla
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CAPDyKFr9MraGWz7hbHyGtFsk7V2_GBUqvWBG5yM40zV6utwXOQ@mail.gmail.com \ --to=ulf.hansson@linaro.org \ --cc=arnd@arndb.de \ --cc=daniel.lezcano@linaro.org \ --cc=dmitry.baryshkov@linaro.org \ --cc=johan@kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=lpieralisi@kernel.org \ --cc=mark.rutland@arm.com \ --cc=rafael@kernel.org \ --cc=soc@kernel.org \ --cc=sudeep.holla@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.