Skip to content

Commit

Permalink
watchdog: rti: of: honor timeout-sec property
Browse files Browse the repository at this point in the history
commit 4962ee0 upstream.

Currently "timeout-sec" Device Tree property is being silently ignored:
even though watchdog_init_timeout() is being used, the driver always passes
"heartbeat" == DEFAULT_HEARTBEAT == 60 as argument.

Fix this by setting struct watchdog_device::timeout to DEFAULT_HEARTBEAT
and passing real module parameter value to watchdog_init_timeout() (which
may now be 0 if not specified).

Cc: [email protected]
Fixes: 2d63908 ("watchdog: Add K3 RTI watchdog support")
Signed-off-by: Alexander Sverdlin <[email protected]>
Reviewed-by: Vignesh Raghavendra <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ccpalex authored and gregkh committed Dec 14, 2024
1 parent c5797f1 commit f505fb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/watchdog/rti_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

#define MAX_HW_ERROR 250

static int heartbeat = DEFAULT_HEARTBEAT;
static int heartbeat;

/*
* struct to hold data for each WDT device
Expand Down Expand Up @@ -252,6 +252,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
wdd->min_timeout = 1;
wdd->max_hw_heartbeat_ms = (WDT_PRELOAD_MAX << WDT_PRELOAD_SHIFT) /
wdt->freq * 1000;
wdd->timeout = DEFAULT_HEARTBEAT;
wdd->parent = dev;

watchdog_set_drvdata(wdd, wdt);
Expand Down

0 comments on commit f505fb7

Please sign in to comment.