mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: barebox@lists.infradead.org, a.fatoum@pengutronix.de
Subject: Re: [PATCH v2 2/2] mfd: da9063: fix watchdog ping execution
Date: Tue, 5 Nov 2019 11:10:21 +0100	[thread overview]
Message-ID: <20191105101021.deksnoqcbcyqho4f@pengutronix.de> (raw)
In-Reply-To: <20191104102806.8044-2-m.felsch@pengutronix.de>

On Mon, Nov 04, 2019 at 11:28:06AM +0100, Marco Felsch wrote:
> The watchdog resets the system if the watchdog gets pinged to fast.
> Between each watchdog ping must be a pause of at least 200ms. This
> commit fixes that by rejecting two fast requests.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> @@ -237,6 +239,14 @@ static int da9063_watchdog_ping(struct da9063 *priv)
>  	int ret;
>  	u8 val;
>  
> +	/*
> +	 * The watchdog has a cool down phase of 200ms and if we ping to fast
> +	 * the da9062/3 resets the system. Reject those requests has a maximum
> +	 * failure of 10% if the watchdog timeout is set to 2.048s.
> +	 */
> +	if ((int64_t)(priv->last_ping + 200 * MSECOND - get_time_ns()) > 0)
> +		return 0;

Changed this to:

	if (!is_timeout(priv->last_ping, 200 * MSECOND))
		return 0;

And applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2019-11-05 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 10:28 [PATCH v2 1/2] mfd: da9063: fix TWDSCALE debug message Marco Felsch
2019-11-04 10:28 ` [PATCH v2 2/2] mfd: da9063: fix watchdog ping execution Marco Felsch
2019-11-05 10:10   ` Sascha Hauer [this message]

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=20191105101021.deksnoqcbcyqho4f@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.de \
    /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