LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "A.s. Dong" <aisheng.dong@nxp.com>
To: Anson Huang <anson.huang@nxp.com>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH] clocksource: imx-tpm: correct -ETIME return condition check
Date: Thu, 19 Apr 2018 07:14:42 +0000	[thread overview]
Message-ID: <AM0PR04MB421199C55AAD04D969B23C9180B50@AM0PR04MB4211.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1524117883-2484-1-git-send-email-Anson.Huang@nxp.com>

> -----Original Message-----
> From: Anson Huang
> Sent: Thursday, April 19, 2018 2:05 PM
> To: daniel.lezcano@linaro.org; tglx@linutronix.de; linux-
> kernel@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: [PATCH] clocksource: imx-tpm: correct -ETIME return condition
> check
> 
> The additional brakets added to tpm_set_next_event's return value
> computation causes (int) forced type conversion NOT taking effect, and the
> incorrect value return will cause various system timer issue, like RCU stall etc..
> 
> This patch removes the additional brakets to make sure
> tpm_set_next_event always returns correct value.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

It's my mistake. Thanks for spotting it out.

Acked-by: Dong Aisheng <Aisheng.dong@nxp.com>

Regards
Dong Aisheng

> ---
> 	resend, since I got failure message of sending mail to linux-
> kernel@vger.kernel.org.
>  drivers/clocksource/timer-imx-tpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/timer-imx-tpm.c b/drivers/clocksource/timer-
> imx-tpm.c
> index 05d97a6..6c83184 100644
> --- a/drivers/clocksource/timer-imx-tpm.c
> +++ b/drivers/clocksource/timer-imx-tpm.c
> @@ -114,7 +114,7 @@ static int tpm_set_next_event(unsigned long delta,
>  	 * of writing CNT registers which may cause the min_delta event got
>  	 * missed, so we need add a ETIME check here in case it happened.
>  	 */
> -	return (int)((next - now) <= 0) ? -ETIME : 0;
> +	return (int)(next - now) <= 0 ? -ETIME : 0;
>  }
> 
>  static int tpm_set_state_oneshot(struct clock_event_device *evt)
> --
> 2.7.4

  reply	other threads:[~2018-04-19  7:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  6:04 Anson Huang
2018-04-19  7:14 ` A.s. Dong [this message]
2018-04-19 11:25 ` [tip:timers/urgent] clocksource/imx-tpm: Correct " tip-bot for Anson Huang

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=AM0PR04MB421199C55AAD04D969B23C9180B50@AM0PR04MB4211.eurprd04.prod.outlook.com \
    --to=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --subject='RE: [PATCH] clocksource: imx-tpm: correct -ETIME return condition check' \
    /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

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).