From: Lorenzo Pieralisi <lpieralisi@kernel.org>
To: Elliot Berman <quic_eberman@quicinc.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Sebastian Reichel <sre@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
Andy Yan <andy.yan@rock-chips.com>,
Mark Rutland <mark.rutland@arm.com>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
Melody Olvera <quic_molvera@quicinc.com>,
Shivendra Pratap <quic_spratap@quicinc.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Florian Fainelli <florian.fainelli@broadcom.com>,
linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v5 3/4] firmware: psci: Read and use vendor reset types
Date: Fri, 9 Aug 2024 15:30:38 +0200 [thread overview]
Message-ID: <ZrYZ/i1QFhfmv0zi@lpieralisi> (raw)
In-Reply-To: <20240807103245593-0700.eberman@hu-eberman-lv.qualcomm.com>
On Wed, Aug 07, 2024 at 11:10:50AM -0700, Elliot Berman wrote:
[...]
> > > +static void psci_vendor_sys_reset2(unsigned long action, void *data)
> >
> > 'action' is unused and therefore it is not really needed.
> >
> > > +{
> > > + const char *cmd = data;
> > > + unsigned long ret;
> > > + size_t i;
> > > +
> > > + for (i = 0; i < num_psci_reset_params; i++) {
> > > + if (!strcmp(psci_reset_params[i].mode, cmd)) {
> > > + ret = invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2),
> > > + psci_reset_params[i].reset_type,
> > > + psci_reset_params[i].cookie, 0);
> > > + pr_err("failed to perform reset \"%s\": %ld\n",
> > > + cmd, (long)ret);
> > > + }
> > > + }
> > > +}
> > > +
> > > static int psci_sys_reset(struct notifier_block *nb, unsigned long action,
> > > void *data)
> > > {
> > > + if (data && num_psci_reset_params)
> >
> > So, reboot_mode here is basically ignored; if there is a vendor defined
> > reset, we fire it off.
> >
> > I think Mark mentioned his concerns earlier related to REBOOT_* mode and
> > reset type (granted, the context was different):
> >
> > https://lore.kernel.org/all/20200320120105.GA36658@C02TD0UTHF1T.local/
> >
> > I would like to understand if this is the right thing to do before
> > accepting this patchset.
> >
>
> I don't have any concerns to move this part below checking reboot_mode.
> Or, I could add reboot_mode == REBOOT_COLD check.
The question is how can we map vendor specific reboot magic to Linux
reboot modes sensibly in generic PSCI code - that's by definition
vendor specific.
Thanks,
Lorenzo
> I'm not sure how best to define the behavior if user sets
> reboot_mode = REBOOT_WARM and then user does "reboot bootloader". IMO,
> "REBOOT_WARM" is at odds with the "bootloader" command. We can have one
> take precedence over the other. I chose for the vendor resets to take
> priority, since if userspace is providing specific command at reboot
> time, that's probably what they want.
>
> Let me know your thoughts and I'm happy to change the behavior around.
>
>
> Thanks,
> Elliot
next prev parent reply other threads:[~2024-08-09 13:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 17:18 [PATCH v5 0/4] Implement vendor resets for PSCI SYSTEM_RESET2 Elliot Berman
2024-06-17 17:18 ` [PATCH v5 1/4] dt-bindings: power: reset: Convert mode-.* properties to array Elliot Berman
2024-06-27 20:10 ` Rob Herring (Arm)
2024-06-17 17:18 ` [PATCH v5 2/4] dt-bindings: arm: Document reboot mode magic Elliot Berman
2024-06-27 20:11 ` Rob Herring (Arm)
2024-06-17 17:18 ` [PATCH v5 3/4] firmware: psci: Read and use vendor reset types Elliot Berman
2024-06-19 13:51 ` Sudeep Holla
2024-06-19 15:28 ` Elliot Berman
2024-06-20 23:37 ` Elliot Berman
2024-06-24 15:41 ` Sudeep Holla
2024-07-02 23:06 ` Elliot Berman
2024-07-02 23:42 ` Trilok Soni
2024-07-09 3:50 ` Trilok Soni
2024-07-09 11:19 ` Sudeep Holla
2024-08-06 14:38 ` Shivendra Pratap
2024-06-24 15:56 ` Sudeep Holla
2024-08-07 15:02 ` Lorenzo Pieralisi
2024-08-07 18:10 ` Elliot Berman
2024-08-09 13:30 ` Lorenzo Pieralisi [this message]
2024-08-09 16:58 ` Elliot Berman
2024-08-12 18:16 ` Shivendra Pratap
2024-08-15 14:40 ` Lorenzo Pieralisi
2024-08-15 18:05 ` Elliot Berman
2024-08-16 18:21 ` Shivendra Pratap
2024-10-15 12:26 ` Lorenzo Pieralisi
2024-06-17 17:18 ` [PATCH v5 4/4] arm64: dts: qcom: Add PSCI SYSTEM_RESET2 types for qcm6490-idp Elliot Berman
2024-06-18 14:23 ` Konrad Dybcio
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=ZrYZ/i1QFhfmv0zi@lpieralisi \
--to=lpieralisi@kernel.org \
--cc=andersson@kernel.org \
--cc=andy.yan@rock-chips.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=quic_eberman@quicinc.com \
--cc=quic_molvera@quicinc.com \
--cc=quic_satyap@quicinc.com \
--cc=quic_spratap@quicinc.com \
--cc=robh@kernel.org \
--cc=sre@kernel.org \
--cc=vkoul@kernel.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).