Skip to content

Commit e3b3afd

Browse files
M-VaittinenWim Van Sebroeck
authored andcommitted
watchdog: bd9576: Drop "always-running" property
The always-running (from linux,wdt-gpio.yaml) is abused by the BD9576 watchdog driver. It's defined meaning is "the watchdog is always running and can not be stopped". The BD9576 watchdog driver has implemented it as "start watchdog when loading the module and prevent it from being stopped". Furthermore, the implementation does not set the WDOG_HW_RUNNING when enabling the watchdog due to the "always-running" at module loading. This will end up resulting a watchdog timeout if the device is not opened. The culprit was pointed out by Guenter, discussion can be found from https://lore.kernel.org/lkml/[email protected]/ Drop the invalid "always-running" handling. Signed-off-by: Matti Vaittinen <[email protected]> Reported-by: Guenter Roeck <[email protected]> Fixes: b237bca ("wdt: Support wdt on ROHM BD9576MUF and BD9573MUF") Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/ZhPAt76yaJMersXf@fedora Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 56e23c6 commit e3b3afd

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

drivers/watchdog/bd9576_wdt.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct bd9576_wdt_priv {
2929
struct gpio_desc *gpiod_en;
3030
struct device *dev;
3131
struct regmap *regmap;
32-
bool always_running;
3332
struct watchdog_device wdd;
3433
};
3534

@@ -62,10 +61,7 @@ static int bd9576_wdt_stop(struct watchdog_device *wdd)
6261
{
6362
struct bd9576_wdt_priv *priv = watchdog_get_drvdata(wdd);
6463

65-
if (!priv->always_running)
66-
bd9576_wdt_disable(priv);
67-
else
68-
set_bit(WDOG_HW_RUNNING, &wdd->status);
64+
bd9576_wdt_disable(priv);
6965

7066
return 0;
7167
}
@@ -264,9 +260,6 @@ static int bd9576_wdt_probe(struct platform_device *pdev)
264260
if (ret)
265261
return ret;
266262

267-
priv->always_running = device_property_read_bool(dev->parent,
268-
"always-running");
269-
270263
watchdog_set_drvdata(&priv->wdd, priv);
271264

272265
priv->wdd.info = &bd957x_wdt_ident;
@@ -281,9 +274,6 @@ static int bd9576_wdt_probe(struct platform_device *pdev)
281274

282275
watchdog_stop_on_reboot(&priv->wdd);
283276

284-
if (priv->always_running)
285-
bd9576_wdt_start(&priv->wdd);
286-
287277
return devm_watchdog_register_device(dev, &priv->wdd);
288278
}
289279

0 commit comments

Comments
 (0)