Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: dongas86@gmail.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/2] timer: imx-tpm: add imx tpm timer support
Date: Mon, 19 Jun 2017 23:36:39 +0800	[thread overview]
Message-ID: <20170619153638.GB8913@b29396-OptiPlex-7040> (raw)
In-Reply-To: <2318694.E4xdUbedMD@ws-stein>

On Tue, Jun 13, 2017 at 10:19:47AM +0200, Alexander Stein wrote:
> On Tuesday 13 June 2017 15:58:45, Dong Aisheng wrote:
> > diff --git a/drivers/clocksource/timer-imx-tpm.c
> > b/drivers/clocksource/timer-imx-tpm.c new file mode 100644
> > index 0000000..940a4f75
> > --- /dev/null
> > +++ b/drivers/clocksource/timer-imx-tpm.c
> > @@ -0,0 +1,227 @@
> > [...]
> > +static int tpm_set_next_event(unsigned long delta,
> > +				struct clock_event_device *evt)
> > +{
> > +	unsigned long next, now;
> > +
> > +	next = readl(timer_base + TPM_CNT) + delta;
> > +	writel(next, timer_base + TPM_C0V);
> > +	now = readl(timer_base + TPM_CNT);
> 
> What about:
> > now = readl(timer_base + TPM_CNT);
> > next = now + delta;
> > writel(next, timer_base + TPM_C0V);
> > return 0;
> 
> > +	return (int)((next - now) <= 0) ? -ETIME : 0;
> 
> Can this error actually happen, even with your implementation?

Yes, i did observe some -ETIME when testing with nanosleep or
hrtimer during programing min_delta event, especially when system
is high loading. e.g. run GPU stress test.

Please also refer to another mail for details i just replied to Daniel.

Regards
Dong Aisheng

  reply	other threads:[~2017-06-19 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13  7:58 [PATCH V2 0/2] timer: add imx tpm timer support Dong Aisheng
2017-06-13  7:58 ` [PATCH V2 1/2] dt-bindings: timer: add nxp tpm timer binding doc Dong Aisheng
2017-06-13  7:58 ` [PATCH V2 2/2] timer: imx-tpm: add imx tpm timer support Dong Aisheng
2017-06-13  8:19   ` Alexander Stein
2017-06-19 15:36     ` Dong Aisheng [this message]
2017-06-13 13:54   ` Daniel Lezcano
2017-06-19 15:34     ` Dong Aisheng

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=20170619153638.GB8913@b29396-OptiPlex-7040 \
    --to=dongas86@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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