From: Artur Kowalski <arturkow2000@gmail.com>
To: Daniel Lezcano <daniel.lezcano@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Prashant Gaikwad <pgaikwad@nvidia.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>
Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-watchdog@vger.kernel.org, linux-doc@vger.kernel.org,
clamor95@gmail.com, Artur Kowalski <arturkow2000@gmail.com>,
linux-clk@vger.kernel.org
Subject: [PATCH v2 0/6] watchdog: Add Tegra20 watchdog driver
Date: Tue, 24 Nov 2026 22:05:58 +0100 [thread overview]
Message-ID: <20261124-t20-for-upstream-v2-0-440116846f97@gmail.com> (raw)
The motivation is to improve recovery from kernel hangs, which have been
steadily driving me to the doorstep of a psych ward for a few months.
They are rare: some happen at boot, others while using the tablet for
something real, like reading PDFs, browsing the web (to the extent
possible without working GPU accel), or just using it as a thin client for
another device.
All my attempts to find even the slightest hint of what went wrong have
come to nothing (the device just refuses to hang with UART connected),
so this series is born in the hope that it will finally enable me and
others to catch those bugs (using the watchdog and pstore).
Tegra20 has no dedicated watchdog block. Instead, the clock and reset
controller can reset the system when timer 1's interrupt fires while the
previous one is still pending. This series adds a tegra20_wdt driver for
it, which takes over a watchdog left running by the bootloader.
Tegra20's boot ROM hangs after a watchdog reset if the VDE partition is
off (for normal reboots, this is handled by 8f0c714ad9be). The series
offers two mitigations:
- By default, tegra20_wdt stops the watchdog for good before the
partition is powered off for the first time, using a new PMC power
off notifier (patches 5 and 6). A watchdog started by the bootloader
still covers early boot, until the PMC driver comes up. After that,
opening the device, keepalives and timeout changes fail with -EBUSY.
Booting with tegra20_wdt.stop_on_vde_off=0 keeps the
watchdog running instead, at the risk of the system hanging instead
of rebooting.
- Booting with tegra_pmc.vde_always_on=1 keeps the partition powered
on, so the watchdog is fully usable, at the expense of higher power
consumption.
This has been tested on ASUS TF101:
- with tegra_pmc.vde_always_on=1, the watchdog stays on. The device has
been running for several hours with no issues. Suspend/resume works,
and the watchdog keeps working after resume, both when only the
watchdog core pings it and when user space has it open. The watchdog
resets the system both when user space stops pinging it and when the
kernel crashes, and U-Boot and Linux boot normally after the warm
reset.
- with the default settings, the watchdog taken over from the
bootloader is stopped when the PMC driver powers off the VDE
partition. After that, opening the device fails with -EBUSY, and the
system keeps running without resets.
Another series for fixing some other issues with warm reboots (not
related to watchdog itself) will follow shortly.
Patch 5 is flagged by checkpatch (WARNING: ENOSYS means 'invalid
syscall nr' and nothing else). I kept it as-is for consistency with the
existing stubs. If this is not desirable, just tell me.
---
Patch 3 depends on patches 1 and 2 and must not be merged before them:
otherwise the watchdog driver conflicts with the clocksource driver over
timer 1, and the clock driver helpers it uses are missing. Patch 6
depends on patch 5.
To: Daniel Lezcano <daniel.lezcano@kernel.org>
To: Thomas Gleixner <tglx@kernel.org>
To: Thierry Reding <thierry.reding@kernel.org>
To: Jonathan Hunter <jonathanh@nvidia.com>
To: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Guenter Roeck <linux@roeck-us.net>
To: Jonathan Corbet <corbet@lwn.net>
To: Shuah Khan <skhan@linuxfoundation.org>
To: Randy Dunlap <rdunlap@infradead.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-watchdog@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: clamor95@gmail.com
Signed-off-by: Artur Kowalski <arturkow2000@gmail.com>
---
Changes in v2:
- Add Tegra20 support as a separate tegra20_wdt driver instead of
extending tegra_wdt, and drop the tegra_wdt match data refactor
(Guenter)
- Access RST_SOURCE through helpers exported by the clock driver
instead of mapping the clock and reset controller's registers
(Krzysztof)
- Validate the heartbeat parameter with watchdog_init_timeout()
- vde_always_on now has effect only on T20
- Leave the watchdog core's state alone in the VDE power off notifier,
which raced with the core and leaked its references (Sashiko)
- Refuse timeout changes after VDE power off before changing the
timeout (Sashiko)
- Fail pings after VDE power off, so that user space finds out
(Sashiko)
- Document that stop_on_vde_off takes precedence over nowayout
- Document the parameters of tegra20_wdt in watchdog-parameters.rst
- Link to v1: https://patch.msgid.link/20261110-t20-for-upstream-v1-0-5923449951fe@gmail.com
To: Daniel Lezcano <daniel.lezcano@kernel.org>
To: Thomas Gleixner <tglx@kernel.org>
To: Thierry Reding <thierry.reding@kernel.org>
To: Jonathan Hunter <jonathanh@nvidia.com>
To: Prashant Gaikwad <pgaikwad@nvidia.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney+clk@redhat.com>
To: Jerome Brunet <jbrunet+clk@baylibre.com>
To: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Guenter Roeck <linux@roeck-us.net>
To: Jonathan Corbet <corbet@lwn.net>
To: Shuah Khan <skhan@linuxfoundation.org>
To: Randy Dunlap <rdunlap@infradead.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-watchdog@vger.kernel.org
Cc: linux-doc@vger.kernel.org
---
Artur Kowalski (6):
clocksource/drivers/timer-tegra: Keep Tegra20's watchdog timers free
clk: tegra20: Add watchdog reset control helpers
watchdog: Add Tegra20 watchdog driver
soc/tegra: pmc: Add an option to keep the VDE partition on
soc/tegra: pmc: Add a partition power off notifier
watchdog: tegra20_wdt: Stop on VDE power off
Documentation/admin-guide/kernel-parameters.txt | 12 +
Documentation/watchdog/watchdog-parameters.rst | 14 +
drivers/clk/tegra/clk-tegra20.c | 60 ++++
drivers/clocksource/timer-tegra.c | 40 ++-
drivers/soc/tegra/pmc.c | 160 ++++++++-
drivers/watchdog/Kconfig | 11 +
drivers/watchdog/Makefile | 1 +
drivers/watchdog/tegra20_wdt.c | 413 ++++++++++++++++++++++++
include/linux/clk/tegra.h | 16 +
include/soc/tegra/pmc.h | 19 ++
10 files changed, 733 insertions(+), 13 deletions(-)
---
base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
change-id: 20261108-t20-for-upstream-497bc765188c
Best regards,
--
Artur Kowalski <arturkow2000@gmail.com>
next reply other threads:[~2026-11-24 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 21:05 Artur Kowalski [this message]
2026-11-24 21:05 ` [PATCH v2 1/6] clocksource/drivers/timer-tegra: Keep Tegra20's watchdog timers free Artur Kowalski
2026-11-24 21:06 ` [PATCH v2 2/6] clk: tegra20: Add watchdog reset control helpers Artur Kowalski
2026-11-24 21:06 ` [PATCH v2 3/6] watchdog: Add Tegra20 watchdog driver Artur Kowalski
2026-11-24 21:06 ` [PATCH v2 4/6] soc/tegra: pmc: Add an option to keep the VDE partition on Artur Kowalski
2026-11-24 21:06 ` [PATCH v2 5/6] soc/tegra: pmc: Add a partition power off notifier Artur Kowalski
2026-11-24 21:06 ` [PATCH v2 6/6] watchdog: tegra20_wdt: Stop on VDE power off Artur Kowalski
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=20261124-t20-for-upstream-v2-0-440116846f97@gmail.com \
--to=arturkow2000@gmail.com \
--cc=bmasney+clk@redhat.com \
--cc=clamor95@gmail.com \
--cc=corbet@lwn.net \
--cc=daniel.lezcano@kernel.org \
--cc=jbrunet+clk@baylibre.com \
--cc=jonathanh@nvidia.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=p.zabel@pengutronix.de \
--cc=pgaikwad@nvidia.com \
--cc=rdunlap@infradead.org \
--cc=sboyd@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=thierry.reding@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
all inboxes | Powered by JetHome®