]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clocksource/drivers/timer-tegra186: Fix support for multiple watchdog instances
authorKartik Rajput <kkartik@nvidia.com>
Thu, 7 May 2026 15:45:54 +0000 (21:15 +0530)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Wed, 10 Jun 2026 05:25:08 +0000 (07:25 +0200)
Tegra SoCs support multiple watchdogs; currently only one (WDT0) is
used. When multiple watchdogs are registered, tegra186_wdt_enable()
overwrites the TKEIE(x) register, discarding any existing watchdog
interrupt enable bits. As a result, enabling one watchdog inadvertently
disables interrupts for the others.

Fix this by preserving the existing TKEIE(x) value and updating it
using a read-modify-write sequence.

Fixes: 42cee19a9f83 ("clocksource: Add Tegra186 timers support")
Cc: stable@vger.kernel.org
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260507154557.2082697-2-kkartik@nvidia.com
drivers/clocksource/timer-tegra186.c

index 355558893e5f3cb76311d6376cdb8dcdc5ed5ccc..bfe16d2d5104eba164070c3af6a457e0a9c2ff93 100644 (file)
@@ -149,7 +149,8 @@ static void tegra186_wdt_enable(struct tegra186_wdt *wdt)
        u32 value;
 
        /* unmask hardware IRQ, this may have been lost across powergate */
-       value = TKEIE_WDT_MASK(wdt->index, 1);
+       value = readl(tegra->regs + TKEIE(wdt->tmr->hwirq));
+       value |= TKEIE_WDT_MASK(wdt->index, 1);
        writel(value, tegra->regs + TKEIE(wdt->tmr->hwirq));
 
        /* clear interrupt */