[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPLW+4nLNkvLf=5KZTmBFe8JFU0=srT9X0m_bYR7V4Vz7A2LeQ@mail.gmail.com>
Date: Sat, 30 Oct 2021 17:59:12 +0300
From: Sam Protsenko <semen.protsenko@...aro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>,
Rob Herring <robh+dt@...nel.org>,
linux-watchdog@...r.kernel.org,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
Linux Samsung SOC <linux-samsung-soc@...r.kernel.org>
Subject: Re: [PATCH 7/7] watchdog: s3c2410: Let kernel kick watchdog
On Fri, 29 Oct 2021 at 11:20, Krzysztof Kozlowski
<krzysztof.kozlowski@...onical.com> wrote:
>
> On 28/10/2021 20:35, Sam Protsenko wrote:
> > When "tmr_atboot" module param is set, the watchdog is started in
> > driver's probe. In that case, also set WDOG_HW_RUNNING bit to let
> > watchdog core driver know it's running. This way wathcdog core can kick
>
> s/wathcdog/watchdog/
>
> > the watchdog for us (if CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED option is
> > enabled), until user space takes control.
>
> This does not explain why you move the code around. I guess you miss
> here information that we should start the watchdog before registering
> it? If so please explain why.
>
Will do in v2, thanks.
> >
> > Signed-off-by: Sam Protsenko <semen.protsenko@...aro.org>
> > ---
> > drivers/watchdog/s3c2410_wdt.c | 26 +++++++++++++++-----------
> > 1 file changed, 15 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> > index ca082b1226e3..9af014ff1468 100644
> > --- a/drivers/watchdog/s3c2410_wdt.c
> > +++ b/drivers/watchdog/s3c2410_wdt.c
> > @@ -732,6 +732,21 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> > wdt->wdt_device.bootstatus = s3c2410wdt_get_bootstatus(wdt);
> > wdt->wdt_device.parent = dev;
> >
> > + /*
> > + * If "tmr_atboot" param is non-zero, start the watchdog right now. Also
> > + * set WDOG_HW_RUNNING bit, so that watchdog core can kick the watchdog.
> > + *
> > + * If we're not enabling the watchdog, then ensure it is disabled if it
> > + * has been left running from the bootloader or other source.
> > + */
> > + if (tmr_atboot && started == 0) {
> > + dev_info(dev, "starting watchdog timer\n");
> > + s3c2410wdt_start(&wdt->wdt_device);
> > + set_bit(WDOG_HW_RUNNING, &wdt->wdt_device.status);
> > + } else if (!tmr_atboot) {
> > + s3c2410wdt_stop(&wdt->wdt_device);
> > + }
> > +
> > ret = watchdog_register_device(&wdt->wdt_device);
> > if (ret)
> > goto err_cpufreq;
> > @@ -740,17 +755,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> > if (ret < 0)
> > goto err_unregister;
> >
> > - if (tmr_atboot && started == 0) {
> > - dev_info(dev, "starting watchdog timer\n");
> > - s3c2410wdt_start(&wdt->wdt_device);
> > - } else if (!tmr_atboot) {
> > - /* if we're not enabling the watchdog, then ensure it is
> > - * disabled if it has been left running from the bootloader
> > - * or other source */
> > -
> > - s3c2410wdt_stop(&wdt->wdt_device);
> > - }
> > -
> > platform_set_drvdata(pdev, wdt);
> >
> > /* print out a statement of readiness */
> >
>
>
> Best regards,
> Krzysztof
Powered by blists - more mailing lists