public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Andrew Bresticker <abrestic@chromium.org>,
	Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ezequiel Garcia <ezequiel.garcia@imgtec.com>,
	James Hogan <james.hogan@imgtec.com>
Subject: Re: [PATCH V3 1/3] watchdog: imgpdc: Allow timeout to be set in device-tree
Date: Sun, 05 Apr 2015 06:03:45 -0700	[thread overview]
Message-ID: <552132B1.1080402@roeck-us.net> (raw)
In-Reply-To: <1428080722-29683-1-git-send-email-abrestic@chromium.org>

On 04/03/2015 10:05 AM, Andrew Bresticker wrote:
> Since the heartbeat is statically initialized to its default value,
> watchdog_init_timeout() will never look in the device-tree for a
> timeout-sec value.  Instead of statically initializing heartbeat,
> fall back to the default timeout value if watchdog_init_timeout()
> fails.
>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
> Cc: James Hogan <james.hogan@imgtec.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> Changes from v2:
>   - Set timeout before calling watchdog_init_timeout
>   - Don't print an error on watchdog_init_timeout failure
> New for v2.
> ---
>   drivers/watchdog/imgpdc_wdt.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c
> index 0deaa4f..d6826a6 100644
> --- a/drivers/watchdog/imgpdc_wdt.c
> +++ b/drivers/watchdog/imgpdc_wdt.c
> @@ -42,7 +42,7 @@
>   #define PDC_WDT_MIN_TIMEOUT		1
>   #define PDC_WDT_DEF_TIMEOUT		64
>
> -static int heartbeat = PDC_WDT_DEF_TIMEOUT;
> +static int heartbeat;
>   module_param(heartbeat, int, 0);
>   MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds "
>   	"(default=" __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")");
> @@ -190,15 +190,11 @@ static int pdc_wdt_probe(struct platform_device *pdev)
>   	pdc_wdt->wdt_dev.info = &pdc_wdt_info;
>   	pdc_wdt->wdt_dev.ops = &pdc_wdt_ops;
>   	pdc_wdt->wdt_dev.max_timeout = 1 << PDC_WDT_CONFIG_DELAY_MASK;
> +	pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT;
>   	pdc_wdt->wdt_dev.parent = &pdev->dev;
>   	watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt);
>
> -	ret = watchdog_init_timeout(&pdc_wdt->wdt_dev, heartbeat, &pdev->dev);
> -	if (ret < 0) {
> -		pdc_wdt->wdt_dev.timeout = pdc_wdt->wdt_dev.max_timeout;
> -		dev_warn(&pdev->dev,
> -			 "Initial timeout out of range! setting max timeout\n");
> -	}
> +	watchdog_init_timeout(&pdc_wdt->wdt_dev, heartbeat, &pdev->dev);
>
>   	pdc_wdt_stop(&pdc_wdt->wdt_dev);
>
>


  parent reply	other threads:[~2015-04-05 13:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 17:05 [PATCH V3 1/3] watchdog: imgpdc: Allow timeout to be set in device-tree Andrew Bresticker
2015-04-03 17:05 ` [PATCH V3 2/3] watchdog: imgpdc: Set timeout before starting watchdog Andrew Bresticker
2015-04-05 13:05   ` Guenter Roeck
2015-04-03 17:05 ` [PATCH V3 3/3] watchdog: imgpdc: Add reboot support Andrew Bresticker
2015-04-05 13:03 ` Guenter Roeck [this message]
2015-04-28 22:51 ` [PATCH V3 1/3] watchdog: imgpdc: Allow timeout to be set in device-tree Ezequiel Garcia
2015-04-28 23:28   ` Ezequiel Garcia
2015-04-29  4:10     ` Guenter Roeck
2015-04-29 12:14       ` Ezequiel Garcia

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=552132B1.1080402@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=abrestic@chromium.org \
    --cc=ezequiel.garcia@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --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