devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
To: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Sebastian Reichel <sre@kernel.org>, Rob Herring <robh@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Souvik Chakravarty <Souvik.Chakravarty@arm.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Yan <andy.yan@rock-chips.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Konrad Dybcio <konradybcio@kernel.org>,
	cros-qcom-dts-watchers@chromium.org,
	Vinod Koul <vkoul@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Moritz Fischer <moritz.fischer@ettus.com>,
	John Stultz <john.stultz@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>,
	Stephen Boyd <swboyd@chromium.org>,
	Andre Draszik <andre.draszik@linaro.org>,
	Kathiravan Thirumoorthy
	<kathiravan.thirumoorthy@oss.qualcomm.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org,
	Elliot Berman <quic_eberman@quicinc.com>,
	Xin Liu <xin.liu@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Umang Chheda <umang.chheda@oss.qualcomm.com>,
	Nirmesh Kumar Singh <nirmesh.singh@oss.qualcomm.com>
Subject: Re: [PATCH v17 07/12] firmware: psci: Implement vendor-specific resets as reboot-mode
Date: Wed, 26 Nov 2025 23:13:05 +0530	[thread overview]
Message-ID: <acd1b134-2c8f-af01-0de9-d9779dd2ebdc@oss.qualcomm.com> (raw)
In-Reply-To: <aSc2Yh3AvLXOBvcz@lpieralisi>



On 11/26/2025 10:48 PM, Lorenzo Pieralisi wrote:
> On Wed, Nov 19, 2025 at 05:32:42PM +0530, Shivendra Pratap wrote:
>>
>>
>> On 11/19/2025 3:07 PM, Lorenzo Pieralisi wrote:
>>> On Tue, Nov 18, 2025 at 11:11:33PM +0530, Shivendra Pratap wrote:
>>>
>>> [...]
>>>
>>>>> Yes this could be a potential way forward but that's decoupled from the
>>>>> options below. If we take this route PSCI maintainers should be added
>>>>> as maintainers for this reboot mode driver.
>>>>
>>>> you mean the new psci_reset driver? yes. Maintainer would be PSCI maintainer,
>>>> if we create a new  psci_reset reboot mode driver.
>>>
>>> Yes.
>>>
>>>>>> - struct with pre-built psci reset_types - (warm, soft, cold). Currently
>>>>>>   only two modes supported, anything other than warm/soft defaults to cold.
>>>>>> - vendor resets to be added as per vendor choice, inside psci device tree(SOC specific).
>>>>>> - psci_reset registers with reboot-mode for registering  vendor resets. Here, we
>>>>>>   have a problem, the pre-built psci reset_types - (warm, soft, cold) cannot be added via
>>>>>>   reboot-mode framework.
>>>>>
>>>>> Why ?
>>>>
>>>> If we want the new psci_reset to take the reboot-mode framework route, is it ok to
>>>> add default modes (warm, cold) in the device tree?
>>>> If not, then the design of reboot-mode framework(power:reset:reboot-mode.c) needs to be
>>>> further changed to equip this new feature. 
>>>
>>> Well, yes, all it needs to do is allowing prepopulated reboot modes on top
>>> of which DT based ones are added.
>>
>> The mode-cold , adds a third variable to reboot-modes as the first parameter for 
>> invoke_psci_fn is different for cold vs warm/vendor.
>>
>> cold reset call       : invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
>> vendor/warm reset call: invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), vendor, cookiee, 0);
>>
>> Each mode will have 3 argument - like:
>> _ _ _ _ _ _ _ _ _ _ _ _ _  _ _ _ _ _ _ 
>> MODE   , cold reset, reset_type, cookie
>> _ _ _ _ _ _ _ _ _ _ _ _ _  _ _ _ _ _ _ - 
>> COLD   ,   1       ,    0      ,     0
>> WARM   ,   0       ,    0      ,     0
>> vendor1,   0       ,0x80000000 ,     1
>> vendor2,   0       ,0x80000010 ,     0
>>
>> So reboot-mode framework will now define and support upto three 32 bit arguments for each mode?
> 
> The cookie value is unused for SYSTEM_WARM_RESET, you can encode there whether
> it is a cold (SYSTEM_RESET) or warm (SYSTEM_RESET2 - SYSTEM_WARM_RESET) architectural
> reset when the magic value(aka reset_type) == 0x0 ?

sure that should work. if reset_type is 0, cookie to decide warm vs cold.

> 
> The reboot mode parameters do not necessarily need to map to PSCI function
> calls parameters - provided we define that explicitly.

got it.

Sorry for out of inline question - 
So the psci_sys_reset() may be looking like below after the changes suggested?
Is this on track?

if( panic_in_progress() || !psci_reset_cmd.valid) {
        if ((reboot_mode == REBOOT_WARM || reboot_mode == REBOOT_SOFT) &&
            psci_system_reset2_supported) {
                /*
                 * reset_type[31] = 0 (architectural)
                 * reset_type[30:0] = 0 (SYSTEM_WARM_RESET)
                 * cookie = 0 (ignored by the implementation)
                 */
                invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), 0, 0, 0);
        } else {
                invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
        }
} else {
        invoke_psci_fn(<psci_reset_cmd.system_reset>, <psci_reset_cmd.reset_type>, <psci_reset_cmd.cookie>, 0);
}

------
where psci_reset_cmd is defined like below?

struct psci_sysreset {
        u32 system_reset; // this will be set as PSCI_FN_NATIVE(1_1, SYSTEM_RESET2) or PSCI_0_2_FN_SYSTEM_RESET.
        u32 reset_type;
        u32 cookie;
        bool valid;
};

static struct psci_sysreset psci_reset_cmd;
--

thanks,
Shivendra

  reply	other threads:[~2025-11-26 17:43 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-09 14:37 [PATCH v17 00/12] Implement vendor resets for PSCI SYSTEM_RESET2 Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 01/12] power: reset: reboot-mode: Remove devres based allocations Shivendra Pratap
2025-11-10 13:01   ` Mukesh Ojha
2025-11-10 13:20     ` Shivendra Pratap
2025-11-10 13:10   ` Bartosz Golaszewski
2025-11-10 13:17     ` Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 02/12] power: reset: reboot-mode: Add firmware node based registration Shivendra Pratap
2025-11-10 13:13   ` Mukesh Ojha
2025-11-10 13:21     ` Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 03/12] power: reset: reboot-mode: Add support for 64 bit magic Shivendra Pratap
2025-11-10 13:45   ` Mukesh Ojha
2025-11-10 14:38     ` Shivendra Pratap
2025-11-10 16:30     ` Bjorn Andersson
2025-11-10 17:52       ` Shivendra Pratap
2025-11-10 18:33         ` Bjorn Andersson
2025-11-11 14:50           ` Shivendra Pratap
2025-11-11 16:25             ` Bjorn Andersson
2025-11-11 16:30               ` Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 04/12] Documentation: ABI: Add sysfs-class-reboot-mode-reboot_modes Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 05/12] power: reset: reboot-mode: Expose sysfs for registered reboot_modes Shivendra Pratap
2025-11-10 15:14   ` Bartosz Golaszewski
2025-11-12 16:57     ` Shivendra Pratap
2025-11-10 16:15   ` Bjorn Andersson
2025-11-12 17:24     ` Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 06/12] dt-bindings: arm: Document reboot mode magic Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 07/12] firmware: psci: Implement vendor-specific resets as reboot-mode Shivendra Pratap
2025-11-10  4:40   ` Kathiravan Thirumoorthy
2025-11-10 14:41     ` Shivendra Pratap
2025-11-10 17:22   ` Lorenzo Pieralisi
2025-11-17 17:44     ` Shivendra Pratap
2025-11-18 12:28       ` Lorenzo Pieralisi
2025-11-18 17:41         ` Shivendra Pratap
2025-11-19  9:37           ` Lorenzo Pieralisi
2025-11-19 12:02             ` Shivendra Pratap
2025-11-26 17:18               ` Lorenzo Pieralisi
2025-11-26 17:43                 ` Shivendra Pratap [this message]
2025-11-09 14:37 ` [PATCH v17 08/12] arm64: dts: qcom: qcm6490-idp: Add PSCI SYSTEM_RESET2 types Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 09/12] arm64: dts: qcom: qcs6490-rb3gen2: " Shivendra Pratap
2025-11-10 12:28   ` Mukesh Ojha
2025-11-10 15:30     ` Bjorn Andersson
2025-11-10 16:19       ` Mukesh Ojha
2025-11-11 16:52         ` Bjorn Andersson
2025-11-12 11:15           ` Mukesh Ojha
2025-11-12 17:25             ` Shivendra Pratap
2025-11-11 16:59   ` Bjorn Andersson
2025-11-12 17:29     ` Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 10/12] arm64: dts: qcom: lemans: " Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 11/12] arm64: dts: qcom: monaco: " Shivendra Pratap
2025-11-09 14:37 ` [PATCH v17 12/12] arm64: dts: qcom: talos: " Shivendra Pratap
2025-11-10 12:39   ` Mukesh Ojha

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=acd1b134-2c8f-af01-0de9-d9779dd2ebdc@oss.qualcomm.com \
    --to=shivendra.pratap@oss.qualcomm.com \
    --cc=Souvik.Chakravarty@arm.com \
    --cc=andersson@kernel.org \
    --cc=andre.draszik@linaro.org \
    --cc=andy.yan@rock-chips.com \
    --cc=arnd@arndb.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=cros-qcom-dts-watchers@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=john.stultz@linaro.org \
    --cc=kathiravan.thirumoorthy@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.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=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=moritz.fischer@ettus.com \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=nirmesh.singh@oss.qualcomm.com \
    --cc=quic_eberman@quicinc.com \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=srini@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=swboyd@chromium.org \
    --cc=umang.chheda@oss.qualcomm.com \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    --cc=xin.liu@oss.qualcomm.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: 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).