From: Guenter Roeck <linux@roeck-us.net>
To: Anson Huang <Anson.Huang@nxp.com>,
wim@linux-watchdog.org, shawnguo@kernel.org,
s.hauer@pengutronix.de, kernel@pengutronix.de,
festevam@gmail.com, linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Linux-imx@nxp.com
Subject: Re: [PATCH] watchdog: imx_sc_wdt: Pretimeout should follow SCU firmware format
Date: Wed, 9 Oct 2019 06:42:58 -0700 [thread overview]
Message-ID: <de796993-a973-1b49-05fb-303541da0a77@roeck-us.net> (raw)
In-Reply-To: <1570606667-16729-1-git-send-email-Anson.Huang@nxp.com>
On 10/9/19 12:37 AM, Anson Huang wrote:
> SCU firmware calculates pretimeout based on current time stamp
> instead of watchdog timeout stamp, need to convert the pretimeout
> to SCU firmware's timeout value.
>
> Fixes: 15f7d7fc5542 ("watchdog: imx_sc: Add pretimeout support")
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/imx_sc_wdt.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c
> index 7ea5cf5..8ed89f0 100644
> --- a/drivers/watchdog/imx_sc_wdt.c
> +++ b/drivers/watchdog/imx_sc_wdt.c
> @@ -99,8 +99,14 @@ static int imx_sc_wdt_set_pretimeout(struct watchdog_device *wdog,
> {
> struct arm_smccc_res res;
>
> + /*
> + * SCU firmware calculates pretimeout based on current time
> + * stamp instead of watchdog timeout stamp, need to convert
> + * the pretimeout to SCU firmware's timeout value.
> + */
> arm_smccc_smc(IMX_SIP_TIMER, IMX_SIP_TIMER_SET_PRETIME_WDOG,
> - pretimeout * 1000, 0, 0, 0, 0, 0, &res);
> + (wdog->timeout - pretimeout) * 1000, 0, 0, 0,
> + 0, 0, &res);
> if (res.a0)
> return -EACCES;
>
>
prev parent reply other threads:[~2019-10-09 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 7:37 [PATCH] watchdog: imx_sc_wdt: Pretimeout should follow SCU firmware format Anson Huang
2019-10-09 13:42 ` Guenter Roeck [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=de796993-a973-1b49-05fb-303541da0a77@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Anson.Huang@nxp.com \
--cc=Linux-imx@nxp.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=wim@linux-watchdog.org \
/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;
as well as URLs for NNTP newsgroup(s).