[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <acd1b134-2c8f-af01-0de9-d9779dd2ebdc@oss.qualcomm.com>
Date: Wed, 26 Nov 2025 23:13:05 +0530
From: Shivendra Pratap <shivendra.pratap@....qualcomm.com>
To: Lorenzo Pieralisi <lpieralisi@...nel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Bjorn Andersson <andersson@...nel.org>,
Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
Sudeep Holla <sudeep.holla@....com>,
Souvik Chakravarty <Souvik.Chakravarty@....com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley
<conor+dt@...nel.org>,
Andy Yan <andy.yan@...k-chips.com>,
Mark Rutland <mark.rutland@....com>, Arnd Bergmann <arnd@...db.de>,
Konrad Dybcio <konradybcio@...nel.org>,
cros-qcom-dts-watchers@...omium.org, Vinod Koul <vkoul@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Moritz Fischer <moritz.fischer@...us.com>,
John Stultz <john.stultz@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Mukesh Ojha <mukesh.ojha@....qualcomm.com>,
Stephen Boyd <swboyd@...omium.org>,
Andre Draszik
<andre.draszik@...aro.org>,
Kathiravan Thirumoorthy <kathiravan.thirumoorthy@....qualcomm.com>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org,
Elliot Berman <quic_eberman@...cinc.com>,
Xin Liu <xin.liu@....qualcomm.com>,
Srinivas Kandagatla <srini@...nel.org>,
Umang Chheda <umang.chheda@....qualcomm.com>,
Nirmesh Kumar Singh <nirmesh.singh@....qualcomm.com>
Subject: Re: [PATCH v17 07/12] firmware: psci: Implement vendor-specific
resets as reboot-mode
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
Powered by blists - more mailing lists