From: Guenter Roeck <linux@roeck-us.net>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
linux-watchdog@vger.kernel.org
Cc: kernel@pengutronix.de, Wim Van Sebroeck <wim@iguana.be>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] watchdog: dw_wdt: get reset lines from dt
Date: Thu, 22 Sep 2016 06:14:44 -0700 [thread overview]
Message-ID: <89edac4c-a105-21df-de50-367da345806a@roeck-us.net> (raw)
In-Reply-To: <1474527753-22194-3-git-send-email-s.trumtrar@pengutronix.de>
On 09/22/2016 12:02 AM, Steffen Trumtrar wrote:
> The dw_wdt has an external reset line, that can keep the device in reset
> and therefore rendering it useless and also is the only way of stopping
> the watchdog once it was started.
>
> Get the reset lines for this core from the devicetree.
> If resets are not specified just warn but don't fail probing to be compatible
> with all users.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-watchdog@vger.kernel.org
> ---
> drivers/watchdog/dw_wdt.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 2acb51cf5504..e024722e8b3b 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -31,6 +31,7 @@
> #include <linux/pm.h>
> #include <linux/platform_device.h>
> #include <linux/reboot.h>
> +#include <linux/reset.h>
> #include <linux/watchdog.h>
>
> #define WDOG_CONTROL_REG_OFFSET 0x00
> @@ -56,6 +57,7 @@ struct dw_wdt {
> struct clk *clk;
> struct notifier_block restart_handler;
> struct watchdog_device wdd;
> + struct reset_control *rst;
> };
>
> #define to_dw_wdt(wdd) container_of(wdd, struct dw_wdt, wdd)
> @@ -231,6 +233,10 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> + dw_wdt->rst = devm_reset_control_get(&pdev->dev, "dw-wdt");
> + if (IS_ERR(dw_wdt->rst))
> + dev_warn(dev, "No reset lines. Will not be able to stop once started.\n");
This situation is already handled by the driver. Actually, I don't even
know what will happen, since the watchdog core will continue to ping
the watchdog after close, and it won't be possible to unload the driver
if the watchdog is running.
I don't think a warning is warranted in this case. We did not need one before,
we should not need one now.
> +
> wdd = &dw_wdt->wdd;
> wdd->info = &dw_wdt_ident;
> wdd->ops = &dw_wdt_ops;
> @@ -268,6 +274,9 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
> if (ret)
> pr_warn("cannot register restart handler\n");
>
> + if (dw_wdt->rst)
> + reset_control_deassert(dw_wdt->rst);
> +
> return 0;
>
> out_disable_clk:
>
next prev parent reply other threads:[~2016-09-22 13:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 7:02 [PATCH 0/3] watchdog: dw_wdt: add reset lines Steffen Trumtrar
2016-09-22 7:02 ` [PATCH 1/3] watchdog: bindings: " Steffen Trumtrar
2016-09-23 19:59 ` Rob Herring
2016-09-22 7:02 ` [PATCH 2/3] watchdog: dw_wdt: get reset lines from dt Steffen Trumtrar
2016-09-22 13:14 ` Guenter Roeck [this message]
2016-09-22 7:02 ` [PATCH 3/3] watchdog: dw_wdt: add stop watchdog operation Steffen Trumtrar
2016-09-22 13:20 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=89edac4c-a105-21df-de50-367da345806a@roeck-us.net \
--to=linux@roeck-us.net \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=s.trumtrar@pengutronix.de \
--cc=wim@iguana.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®