Skip to content

Commit d5232ab

Browse files
arm64: ac5: Fix watchdog timeleft (#334)
Watchdog timeleft returns unexpected huge value for first read, followed by correct expected values. Unexpected huge value reappears after few minutes. Issue is resolved by updating the existing hardware workaround to read WCV_HI along with WCV_LO. Signed-off-by: Pradeep Turaga Shakthi <[email protected]> Co-authored-by: Saikrishna Arcot <[email protected]>
1 parent ecba611 commit d5232ab

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

patch/0015-ac5-marvell-Add-watchdog-support.patch

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Signed-off-by: Noam Liron <[email protected]>
1212
---
1313
drivers/watchdog/Kconfig | 16 ++
1414
drivers/watchdog/Makefile | 1 +
15-
drivers/watchdog/ac5_gwd.c | 458 +++++++++++++++++++++++++++++++++++++
16-
3 files changed, 475 insertions(+)
15+
drivers/watchdog/ac5_gwd.c | 459 +++++++++++++++++++++++++++++++++++++
16+
3 files changed, 476 insertions(+)
1717
create mode 100644 drivers/watchdog/ac5_gwd.c
1818

1919
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
@@ -57,10 +57,10 @@ index 071a2e50b..acf3df558 100644
5757
obj-$(CONFIG_AT91SAM9X_WATCHDOG) += at91sam9_wdt.o
5858
diff --git a/drivers/watchdog/ac5_gwd.c b/drivers/watchdog/ac5_gwd.c
5959
new file mode 100644
60-
index 000000000..5ba877b9b
60+
index 000000000..994d1a2db
6161
--- /dev/null
6262
+++ b/drivers/watchdog/ac5_gwd.c
63-
@@ -0,0 +1,458 @@
63+
@@ -0,0 +1,459 @@
6464
+// SPDX-License-Identifier: GPL-2.0
6565
+/*
6666
+ * AC5 Watchdog driver
@@ -244,6 +244,7 @@ index 000000000..5ba877b9b
244244
+ low = smc_readl(addr);
245245
+ high = smc_readl(addr + 4);
246246
+ low = smc_readl(addr); /* read twice, as a workaround to HW limitation */
247+
+ high = smc_readl(addr + 4); /* read twice, as a workaround to HW limitation */
247248
+
248249
+ return low + ((u64)high << 32);
249250
+}

0 commit comments

Comments
 (0)