linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM
@ 2025-06-10 13:45 Kathiravan Thirumoorthy
  2025-06-10 13:45 ` [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
	Kathiravan Thirumoorthy, Konrad Dybcio

In Qualcomm IPQ SoCs, if the system is rebooted due to the watchdog
timeout, there is no way to identify it. Current approach of checking
the EXPIRED_STATUS in WDT_STS is not working.

To achieve this, if the system is rebooted due to watchdog timeout, the
information is captured in the IMEM by the bootloader (along with other
reason codes as well).

This series attempts to address this by adding the support to read the
IMEM and populate the information via bootstatus sysfs file.

With the CONFIG_WATCHDOG_SYSFS enabled, user can extract the information
as below:

cat
/sys/devices/platform/soc@0/f410000.watchdog/watchdog/watchdog0/bootstatus
32

Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v5:
- Rename property 'qcom,imem' to 'sram'
- Use dev_err_probe instead of dev_err
- Link to v4:
  https://lore.kernel.org/linux-arm-msm/20250519-wdt_reset_reason-v4-0-d59d21275c75@oss.qualcomm.com/

Changes in v4:
- Kept only the WDIOF_CARDRESET and dropped other codes (Guenter)
- Renamed qcom_wdt_get_restart_reason() to qcom_wdt_get_bootstatus()
- Dropped the device data and describe the required information in the
  DT (Konrad)
- Link to v3:
  https://lore.kernel.org/linux-arm-msm/20250502-wdt_reset_reason-v3-0-b2dc7ace38ca@oss.qualcomm.com/

Changes in v3:
- Picked up the relevant tags
- Dropped the fallback compatible handling
- Split the driver changes into 2. Introduce the device data in one and
  extend the same in another for the use case
- Link to v2:
  https://lore.kernel.org/linux-arm-msm/20250416-wdt_reset_reason-v2-0-c65bba312914@oss.qualcomm.com/

Changes in v2:
- Dropped the RFC tag
- Reworked the driver changes to use the syscon API
- Link to v1:
  https://lore.kernel.org/linux-arm-msm/20250408-wdt_reset_reason-v1-0-e6ec30c2c926@oss.qualcomm.com/

Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>

---
Kathiravan Thirumoorthy (5):
      dt-bindings: sram: qcom,imem: Document IPQ5424 compatible
      arm64: dts: qcom: ipq5424: Add the IMEM node
      dt-bindings: watchdog: qcom-wdt: Document sram property
      watchdog: qcom: add support to get the bootstatus from IMEM
      arm64: dts: qcom: ipq5424: add support to get watchdog bootstatus from IMEM

 .../devicetree/bindings/sram/qcom,imem.yaml        |  1 +
 .../devicetree/bindings/watchdog/qcom-wdt.yaml     | 20 ++++++++++
 arch/arm64/boot/dts/qcom/ipq5424.dtsi              | 10 +++++
 drivers/watchdog/qcom-wdt.c                        | 43 +++++++++++++++++++++-
 4 files changed, 72 insertions(+), 2 deletions(-)
---
base-commit: b27cc623e01be9de1580eaa913508b237a7a9673
change-id: 20250610-wdt_reset_reason-7a5afe702075

Best regards,
-- 
Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-07-22  4:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 2/5] arm64: dts: qcom: ipq5424: Add the IMEM node Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property Kathiravan Thirumoorthy
2025-06-10 16:36   ` Rob Herring (Arm)
2025-06-10 18:03   ` Rob Herring
2025-06-16  5:18     ` Kathiravan Thirumoorthy
2025-06-19  5:48       ` Kathiravan Thirumoorthy
2025-07-14 14:51         ` Konrad Dybcio
2025-07-22  4:16           ` Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 4/5] watchdog: qcom: add support to get the bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 5/5] arm64: dts: qcom: ipq5424: add support to get watchdog " Kathiravan Thirumoorthy

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).