public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: guohanjun@huawei•com (Hanjun Guo)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 1/2] ARM64: arch_timer: Work around QorIQ Erratum A-008585
Date: Wed, 29 Jun 2016 15:56:20 +0800	[thread overview]
Message-ID: <57737F24.5050906@huawei.com> (raw)
In-Reply-To: <1463114260-8724-1-git-send-email-oss@buserror.net>

Hello Scott,

On 2016/5/13 12:37, Scott Wood wrote:
[...]
>  
> +#ifdef CONFIG_ARM64
> +static __always_inline void rewrite_tval(const int access,
> +		unsigned long evt, struct clock_event_device *clk)
> +{
> +	u64 cval_old, cval_new;
> +	int timeout = 200;
> +
> +	do {
> +		cval_old = __arch_counter_get_cntvct();
> +		arch_timer_reg_write(access, ARCH_TIMER_REG_TVAL, evt, clk);

For not memory mapped timer, it will call arch_timer_reg_write_cp15() which has
isb() at the end of arch_timer_reg_write_cp15()...

> +		cval_new = __arch_counter_get_cntvct();

So there is isb() between counter retry read, I think it's likely cval_new will
not be equal with cval_old when the cntvct is correct (time lapse is more than
one arch timer cycle).

> +		timeout--;
> +	} while (cval_old != cval_new && timeout);
> +
> +	WARN_ON_ONCE(!timeout);

Then trigger the warning here, correct me if I miss something else.

Thanks
Hanjun

  parent reply	other threads:[~2016-06-29  7:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13  4:37 [PATCH v2 1/2] ARM64: arch_timer: Work around QorIQ Erratum A-008585 Scott Wood
2016-05-13  4:37 ` [PATCH v2 2/2] arm64: dts: Add timer erratum property for LS2080A and LS1043A Scott Wood
2016-05-13 10:24 ` [PATCH v2 1/2] ARM64: arch_timer: Work around QorIQ Erratum A-008585 Marc Zyngier
2016-06-22  1:45   ` Scott Wood
2016-06-25  7:16     ` Ding Tianhong
2016-06-27 13:13     ` Marc Zyngier
2016-06-29  2:05       ` Scott Wood
2016-07-01  6:51       ` Scott Wood
2016-06-29  8:11   ` Hanjun Guo
2016-06-29  8:24     ` Marc Zyngier
2016-06-29  9:19       ` Hanjun Guo
2016-05-16 16:14 ` Rob Herring
2016-06-29  7:56 ` Hanjun Guo [this message]
2016-06-29  8:19   ` Marc Zyngier
2016-06-29  8:31     ` Ding Tianhong

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=57737F24.5050906@huawei.com \
    --to=guohanjun@huawei$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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