From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Kathiravan Thirumoorthy
<kathiravan.thirumoorthy@oss.qualcomm.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
bod.linux@nxsw.ie, Srinivas Kandagatla <srini@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v3 4/4] watchdog: qcom: add support to read the restart reason from IMEM
Date: Fri, 16 May 2025 18:35:15 +0200 [thread overview]
Message-ID: <21bd89b9-9f6e-42d0-bcd3-b6476cf91705@oss.qualcomm.com> (raw)
In-Reply-To: <0a73989f-b018-473c-872a-5cbc2e7d1783@oss.qualcomm.com>
On 5/16/25 2:52 PM, Kathiravan Thirumoorthy wrote:
>
> On 5/16/2025 4:48 PM, Konrad Dybcio wrote:
>> On 5/14/25 3:15 PM, Kathiravan Thirumoorthy wrote:
>>> On 5/6/2025 4:31 PM, Kathiravan Thirumoorthy wrote:
>>>> On 5/3/2025 3:53 AM, Konrad Dybcio wrote:
>>>>> On 5/2/25 6:28 PM, Kathiravan Thirumoorthy wrote:
>>>>>> On 5/2/2025 7:33 PM, Konrad Dybcio wrote:
>>>>>>>> +static int qcom_wdt_get_restart_reason(struct qcom_wdt *wdt,
>>>>>>>> + const struct qcom_wdt_match_data *data)
>>>>>>>> +{
>>>>>>>> + struct regmap *imem;
>>>>>>>> + unsigned int val;
>>>>>>>> + int ret;
>>>>>>>> +
>>>>>>>> + imem = syscon_regmap_lookup_by_compatible(data->imem_compatible);
>>>>>>> Try syscon_regmap_lookup_by_phandle_args() and pass a phandle, see e.g.
>>>>>>> drivers/phy/qualcomm/phy-qcom-qmp-pcie.c & phy@1bfc000 in x1e80100.dtsi
>>>>>>>
>>>>>>> That way all platform specifics will live in the DT, requiring no
>>>>>>> hardcode-y driver changes on similar platforms
>>>>>> Thanks. I thought about this API but it didn't strike that I can use the args to fetch and match the value.
>>>>>>
>>>>>> I need a suggestion here. There is a plan to extend this feature to other IPQ targets and also support WDIOF_POWERUNDER and WDIOF_OVERHEAT cause as well. For IPQ5424, all 3 cause will support and for other IPQ platforms, we are exploring how to integrate WDIOF_OVERHEAT. In any case, can I define the DT entry like below
>>>>>>
>>>>>> imem,phandle = <&imem 0x7b0 <Non secure WDT value> <Power Under value> <Overheat value>>;
>>>>>>
>>>>>> and store these in values args[1], args[2] and args[3] respectively and use it for manipulation? If any of the platform doesn't support all 3, I can update the bindings and define the number of args as required.
>>>>> Let's call the property qcom,restart-reason and only pass the register value
>>>>>
>>>>> Because we may have any number of crazy combinations of various restart
>>>>> reasons, we can go two paths:
>>>>>
>>>>> 1. promise really really really hard we won't be too crazy with the number
>>>>> of possible values and put them in the driver
>>>>> 2. go all out on DT properties (such as `bootstatus-overheat`,
>>>>> `bootstatus-fanfault` etc.
>>>>
>>>> Thanks Konrad for the suggestions and the offline discussions.
>>>>
>>>> @Guenter, I need a suggestion here. Currently as part of this series, we are planning to expose WDIOF_CARDRESET, WDIOF_POWERUNDER, WDIOF_OVERHEAT reasons.
>>>>
>>>> Once this is done, we do have the custom reason codes like Kernel Panic, Secure Watchdog Bite, Bus error timeout, Bus error access and few many. Is it okay to expose these values also via the bootstatus sysFS by extending the current list of reasons? Since these are outside the scope of watchdog, need your thoughts on this.
>>>
>>> Konrad / Guenter,
>>>
>>> We had a further discussion on this internally. Outcome is, it wouldn't be ideal to hook the custom restart reason codes in watchdog framework, since there is no involvement of watchdog in such cases. Also I don't find any references to hook the custom values in watchdog's bootstatus.
>>>
>>> If this is fine, I'm planning to resend the series to handle only the non secure watchdog timeout case. In that case, as suggested by Konrad, everything will be handled in DT like below to avoid the device data.
>>>
>>> imem,phandle = <&phandle <imem_offset> <value>>;
>> the part before the comma is a vendor prefix, so that must be qcom,xyz
>
>
> Sure, will name it as qcom,imem-phandle. Hope this name is fine.
just qcom,imem is fine, phandle is a datatype described in dt-bindings
>> what are your plans for the other reboot reasons? are we scrapping them?
>
>
> No, we are not scrapping it. We are exploring further on where to put this. May be we can put those logic in some simple driver named as ipq-restart-reason.c under drivers/soc/qcom/?
I see drivers/power/reset/at91-reset.c does something like this
Konrad
next prev parent reply other threads:[~2025-05-16 16:35 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-02 13:17 [PATCH v3 0/4] Add support to read the restart reason from IMEM Kathiravan Thirumoorthy
2025-05-02 13:17 ` [PATCH v3 1/4] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
2025-05-02 13:17 ` [PATCH v3 2/4] arm64: dts: qcom: ipq5424: Add the IMEM node Kathiravan Thirumoorthy
2025-05-02 13:17 ` [PATCH v3 3/4] watchdog: qcom: introduce the device data for IPQ5424 watchdog device Kathiravan Thirumoorthy
2025-05-02 13:36 ` Guenter Roeck
2025-05-02 14:53 ` Dmitry Baryshkov
2025-05-02 16:01 ` Kathiravan Thirumoorthy
2025-05-02 13:17 ` [PATCH v3 4/4] watchdog: qcom: add support to read the restart reason from IMEM Kathiravan Thirumoorthy
2025-05-02 13:33 ` Krzysztof Kozlowski
2025-05-02 16:02 ` Kathiravan Thirumoorthy
2025-05-02 13:33 ` Guenter Roeck
2025-05-02 16:08 ` Kathiravan Thirumoorthy
2025-05-02 22:13 ` Konrad Dybcio
2025-05-02 14:03 ` Konrad Dybcio
2025-05-02 16:28 ` Kathiravan Thirumoorthy
2025-05-02 22:23 ` Konrad Dybcio
2025-05-06 11:01 ` Kathiravan Thirumoorthy
2025-05-14 13:15 ` Kathiravan Thirumoorthy
2025-05-14 18:05 ` Guenter Roeck
2025-05-16 11:18 ` Konrad Dybcio
2025-05-16 12:52 ` Kathiravan Thirumoorthy
2025-05-16 16:35 ` Konrad Dybcio [this message]
2025-05-17 10:41 ` Kathiravan Thirumoorthy
2025-05-02 14:54 ` Dmitry Baryshkov
2025-05-02 16:31 ` Kathiravan Thirumoorthy
2025-08-11 18:40 ` (subset) [PATCH v3 0/4] Add " Bjorn Andersson
2025-08-25 12:11 ` Kathiravan Thirumoorthy
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=21bd89b9-9f6e-42d0-bcd3-b6476cf91705@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bod.linux@nxsw.ie \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kathiravan.thirumoorthy@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh@kernel.org \
--cc=srini@kernel.org \
--cc=wim@linux-watchdog.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).