lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/7] clocksource: Add Tegra186 timers support
From
Date
01.04.2020 01:19, Thierry Reding пишет:
...
> +static int tegra186_wdt_set_timeout(struct watchdog_device *wdd,
> + unsigned int timeout)
> +{
> + struct tegra186_wdt *wdt = to_tegra186_wdt(wdd);
> +
> + tegra186_wdt_disable(wdt);
> + wdt->base.timeout = timeout;
> + tegra186_wdt_enable(wdt);

Why changing timeout enables the watchdog?

> + return 0;
> +}
> +
> +static const struct watchdog_ops tegra186_wdt_ops = {
> + .owner = THIS_MODULE,
> + .start = tegra186_wdt_start,
> + .stop = tegra186_wdt_stop,
> + .ping = tegra186_wdt_ping,
> + .set_timeout = tegra186_wdt_set_timeout,
> +};

...
> +static int __maybe_unused tegra186_timer_suspend(struct device *dev)
> +{
> + struct tegra186_timer *tegra = dev_get_drvdata(dev);
> +
> + if (tegra->wdt)
> + tegra186_wdt_disable(tegra->wdt);
> +
> + return 0;
> +}
> +
> +static int __maybe_unused tegra186_timer_resume(struct device *dev)
> +{
> + struct tegra186_timer *tegra = dev_get_drvdata(dev);
> +
> + if (tegra->wdt)
> + tegra186_wdt_enable(tegra->wdt);

What if watchdog is in a stopped state? Why it's enabled unconditionally?

> + return 0;
> +}


\
 
 \ /
  Last update: 2020-04-03 18:25    [W:1.998 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site