lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230819084726.11037-1-othacehe@gnu.org>
Date:   Sat, 19 Aug 2023 10:47:26 +0200
From:   Mathieu Othacehe <othacehe@....org>
To:     nicolas.ferre@...rochip.com, alexandre.belloni@...tlin.com,
        claudiu.beznea@...on.dev, wim@...ux-watchdog.org,
        linux@...ck-us.net
Cc:     linux-arm-kernel@...ts.infradead.org,
        linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org,
        Mathieu Othacehe <othacehe@....org>
Subject: [PATCH] watchdog: sama5d4: readout initial state

Readout the AT91_WDT_MR bit at probe so that it becomes possible to get the
pre-userspace handler working.

Signed-off-by: Mathieu Othacehe <othacehe@....org>
---
 drivers/watchdog/sama5d4_wdt.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c
index aeee934ca51b..7d31bb6f6204 100644
--- a/drivers/watchdog/sama5d4_wdt.c
+++ b/drivers/watchdog/sama5d4_wdt.c
@@ -255,6 +255,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
 	struct sama5d4_wdt *wdt;
 	void __iomem *regs;
 	u32 irq = 0;
+	u32 reg;
 	int ret;
 
 	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
@@ -305,6 +306,12 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
 
 	watchdog_init_timeout(wdd, wdt_timeout, dev);
 
+	reg = wdt_read(wdt, AT91_WDT_MR);
+	if (!(reg & AT91_WDT_WDDIS)) {
+		wdt->mr &= ~AT91_WDT_WDDIS;
+		set_bit(WDOG_HW_RUNNING, &wdd->status);
+	}
+
 	ret = sama5d4_wdt_init(wdt);
 	if (ret)
 		return ret;
-- 
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ