From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: krzk+dt@kernel.org, andersson@kernel.org, konradybcio@kernel.org,
robh@kernel.org, conor+dt@kernel.org, sre@kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/5] power: reset: qcom-pon: Add support for WARM reset
Date: Wed, 12 Nov 2025 12:20:29 +0100 [thread overview]
Message-ID: <4e9d15cd-1ef2-464c-b421-f8a333c53825@oss.qualcomm.com> (raw)
In-Reply-To: <CAFEp6-0sbDj0C9KAMxq1mrGO9jGz4YDMqnf1AGVU49PyGzLi8w@mail.gmail.com>
On 11/12/25 12:16 PM, Loic Poulain wrote:
> Hi Konrad,
>
> On Thu, Nov 6, 2025 at 1:50 PM Konrad Dybcio
> <konrad.dybcio@oss.qualcomm.com> wrote:
>>
>> On 11/5/25 10:44 PM, Loic Poulain wrote:
>>> Hi Konrad,
>>>
>>> On Tue, Nov 4, 2025 at 4:20 PM Konrad Dybcio
>>> <konrad.dybcio@oss.qualcomm.com> wrote:
>>>>
>>>> On 11/4/25 4:01 PM, Loic Poulain wrote:
>>>>> Hi Konrad, Krzysztof,
>>>>>
>>>>> On Tue, Nov 4, 2025 at 12:50 PM Konrad Dybcio
>>>>> <konrad.dybcio@oss.qualcomm.com> wrote:
>>>>>>
>>>>>> On 11/3/25 7:20 PM, Loic Poulain wrote:
>>>>>>> This mechanism can be used when firmware lacks proper warm-reset handling,
>>>>>>> for example, when the PSCI SYSTEM_RESET2 function is not implemented.
>>>>>>> It enables the warm reset functionality via the PMIC.
>>>>>>>
>>>>>>> This fallback is only enabled if qcom,warm-reset property is present.
>>>>>>>
>>>>>>> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
>>>>>>> ---
>>>>>>> drivers/power/reset/qcom-pon.c | 47 ++++++++++++++++++++++++++++++++++
>>>>>>> 1 file changed, 47 insertions(+)
>>>>>>>
>>>>>>> diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
>>>>>>> index 7e108982a582..684e9fe9987d 100644
>>>>>>> --- a/drivers/power/reset/qcom-pon.c
>>>>>>> +++ b/drivers/power/reset/qcom-pon.c
>>>>>>> @@ -19,12 +19,20 @@
>>>>>>>
>>>>>>> #define NO_REASON_SHIFT 0
>>>>>>>
>>>>>>> +#define PON_SW_RESET_S2_CTL 0x62
>>>>>>> +#define PON_SW_RESET_S2_CTL_WARM_RST 0x01
>>>>>>> +#define PON_SW_RESET_S2_CTL2 0x63
>>>>>>> +#define PON_SW_RESET_S2_CTL2_RST_EN BIT(7)
>>>>>>> +#define PON_SW_RESET_GO 0x64
>>>>>>> +#define PON_SW_RESET_GO_MAGIC 0xa5
>>>>>>
>>>>>> Going back to msm8974 where the SPMI arbiter first showed up, these
>>>>>> values are all seemingly valid, so I think we can drop the dt property.
>>>>>> The restart reasons are set in stone too, and you can find more of them
>>>>>> in the register description.
>>>>>
>>>>> Yes, but this should only apply when the platform firmware does not
>>>>> support warm reset via PSCI, right?
>>>>> Making it unconditional would override the PSCI implementation even
>>>>> when warm reset is supported.
>>>>>
>>>>> The point is that psci_sys_reset() executes a cold reset if warm
>>>>> reset isn’t available. Therefore, our PMIC reboot notifier must have a
>>>>> higher priority than the PSCI handler.
>>>>>
>>>>> So maybe the alternative could be to introduce an additional reboot
>>>>> handler in psci, with the lowest priority, so that warm reset can have
>>>>> a chance to run either from the psci main reboot handler or from the
>>>>> PMIC reboot handler before falling back to cold reset?
>>>>> [PSCI-handler]->[other-handlers]->[PSCI-cold-reset-fallback-handler]
>>>>
>>>> This seems like a common enough problem, perhaps the framework could
>>>> accept EOPNOTSUPP or similar and try to delegate further, coming back
>>>> with a normal restart or so, if unsupported. Trying to make a special
>>>> contract between qcom-pon and psci silently will be very fragile
>>>> otherwise.
>>>
>>> I tested the following, as described above:
>>> https://github.com/loicpoulain/linux/commit/5c34ea54e1a21ff1192c3c341877b24eff5f80b4
>>> The only special 'contract' is the handler priority.
>>> If you can elaborate on another/better approach, that would be helpful.
>>
>> Thinking about it again, it'd be difficult to grab some sort of a handle
>> to the ""parent"" reboot mode, so what you propose here is good
>>
>>>>>> That said, we're circumventing PS_HOLD this way - is that intended?
>>>>>
>>>>> Well, we don’t have direct control over PS_HOLD since it’s managed by
>>>>> the firmware in our case. That’s why I considered using the PMIC
>>>>> software reset as an effective way to achieve this warm reset.
>>>>
>>>> Hm, so is there no longer a way to assert it by writing to PMIC
>>>> registers?
>>>
>>> PS_HOLD is a SoC signal, and we can maybe assert it via the
>>> MPM_PS_HOLD register through the msm-poweroff driver if needed (well,
>>> if access is allowed from a non-secure world).
>>> However, this would also require coordination with the PMIC driver to
>>> select the correct PS_HOLD action (shutdown, cold reset, warm reset).
>>> For that reason, I’d prefer to keep PS_HOLD based logic abstracted by PSCI.
>>> Using the SW_RST PMIC register allows us to perform a reset without
>>> additional signal handling.
>>
>> Yeah of course we should use PSCI where functional and available
>>
>> I think PS_HOLD used to be fully manual on old (msm-3.10) platforms
>> through PMIC registers. I see that e.g. msm-4.19 has an SCM call to
>> (de)assert it. There's also a "halt PMIC arbiter" call.
>>
>> (via drivers/power/reset/msm-poweroff.c)
>
> Yes I could try the SCM call to deassert PS_HOLD, is it something we
> should prefer over PMIC soft reset?
> Asking because the implication would be a more complex solution
> (though not yet tested):
> - Adding reboot mode support in qcom-scm to activate ELD mode
> - Adding reset-notifier in pmic driver to modify PS_HOLD action to warm-reset
> - Adding reset-notifier in qcom,scm (of lower priority than PMIC)
> doing the actual SCM ps-hold deassert
> - Ensuring that PSCI is still used for cold-reset and warm-reset when
> supported...
My answer is unfortunately "I don't know". We should loop in some
PMIC folks that would know the difference
Konrad
next prev parent reply other threads:[~2025-11-12 11:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 18:20 [PATCH 0/5] Add EDL reboot and warm reset support for QRB2210 Loic Poulain
2025-11-03 18:20 ` [PATCH 1/5] dt-bindings: power: reset: qcom-pon: Document qcom,warm-reset Loic Poulain
2025-11-04 2:17 ` Bjorn Andersson
2025-11-04 14:03 ` Krzysztof Kozlowski
2025-11-04 15:12 ` Loic Poulain
2025-11-03 18:20 ` [PATCH 2/5] power: reset: qcom-pon: Add support for WARM reset Loic Poulain
2025-11-04 2:19 ` Bjorn Andersson
2025-11-04 11:50 ` Konrad Dybcio
2025-11-04 15:01 ` Loic Poulain
2025-11-04 15:20 ` Konrad Dybcio
2025-11-05 21:44 ` Loic Poulain
2025-11-06 12:50 ` Konrad Dybcio
2025-11-12 11:16 ` Loic Poulain
2025-11-12 11:20 ` Konrad Dybcio [this message]
2025-11-14 15:35 ` Loic Poulain
2025-11-04 14:04 ` Krzysztof Kozlowski
2025-11-03 18:20 ` [PATCH 3/5] dt-bindings: firmware: qcom,scm: Document reboot mode Loic Poulain
2025-11-04 2:16 ` Bjorn Andersson
2025-11-04 2:19 ` Dmitry Baryshkov
2025-11-04 2:45 ` Bjorn Andersson
2025-11-04 21:19 ` Loic Poulain
2025-11-05 9:44 ` Konrad Dybcio
2025-11-05 20:17 ` Loic Poulain
2025-11-06 9:51 ` Konrad Dybcio
2025-11-12 16:36 ` Bjorn Andersson
2025-11-13 11:00 ` Konrad Dybcio
2025-11-13 17:38 ` Bjorn Andersson
2025-11-03 18:20 ` [PATCH 4/5] firmware: qcom: scm: Support for EDL " Loic Poulain
2025-11-04 2:22 ` Bjorn Andersson
2025-11-04 12:09 ` kernel test robot
2025-11-04 13:13 ` kernel test robot
2025-11-03 18:20 ` [PATCH 5/5] arm64: dts: qcom: qrb2210-rb1: Add support for EDL reboot Loic Poulain
2025-11-04 2:20 ` Dmitry Baryshkov
2025-11-04 10:23 ` Loic Poulain
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=4e9d15cd-1ef2-464c-b421-f8a333c53825@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sre@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