Skip to contentSkip to conversation

watchdog: bcm2835: set timeout_max.

PATCH Applied Tomaz Solc 2 participants 2 messages Feb 14, 2019 – Feb 18, 2019

Subsystems (3)
lore
Share & tools
lore

Tomaz Solc

author
#0 lore raw

PATCH 1/1 watchdog: bcm2835: set timeout_max.

BCM2835 watchdog timeout can be set to maximum 15 seconds (0xffffff >> 16).

---
 drivers/watchdog/bcm2835_wdt.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/watchdog/bcm2835_wdt.c +5 -0
index d0c51ed9e..781626fa0 100644
@@ -45,6 +45,10 @@
 
 #define SECS_TO_WDOG_TICKS(x) ((x) << 16)
 
+/* Largest value where SECS_TO_WDOG_TICKS doesn't overflow 20 bits
+ * (PM_WDOG_TIME_SET) */
+#define WDOG_SECS_MAX 15
+
 struct bcm2835_wd {
 	struct watchdog wd;
 	void __iomem *base;
@@ -101,6 +105,7 @@ static int bcm2835_wd_probe(struct device_d *dev)
 	}
 	priv->base = IOMEM(iores->start);
 	priv->wd.set_timeout = bcm2835_wd_set_timeout;
+	priv->wd.timeout_max = WDOG_SECS_MAX;
 	priv->wd.hwdev = dev;
 	priv->dev = dev;
 
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 4 lines · Tomaz Solc

BCM2835 watchdog timeout can be set to maximum 15 seconds (0xffffff >> 16).

---
 drivers/watchdog/bcm2835_wdt.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied, thanks

Sascha

Quoted 33 lines
drivers/watchdog/bcm2835_wdt.c +5 -0
index d0c51ed9e..781626fa0 100644
@@ -45,6 +45,10 @@
 
 #define SECS_TO_WDOG_TICKS(x) ((x) << 16)
 
+/* Largest value where SECS_TO_WDOG_TICKS doesn't overflow 20 bits
+ * (PM_WDOG_TIME_SET) */
+#define WDOG_SECS_MAX 15
+
 struct bcm2835_wd {
 	struct watchdog wd;
 	void __iomem *base;
@@ -101,6 +105,7 @@ static int bcm2835_wd_probe(struct device_d *dev)
 	}
 	priv->base = IOMEM(iores->start);
 	priv->wd.set_timeout = bcm2835_wd_set_timeout;
+	priv->wd.timeout_max = WDOG_SECS_MAX;
 	priv->wd.hwdev = dev;
 	priv->dev = dev;
 
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox