public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Marc Zyngier <marc.zyngier-5wv7dgnIgG8@public.gmane.org>
Cc: Ding Tianhong
	<dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	catalin.marinas-5wv7dgnIgG8@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	oss-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	stuart.yoder-3arQi8VN3Tc@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v9 0/4] arm64: arch_timer: Add workaround for hisilicon-161010101 erratum
Date: Tue, 24 Jan 2017 17:35:51 +0100	[thread overview]
Message-ID: <20170124163551.GB2021@mai> (raw)
In-Reply-To: <35cf654f-3944-fc76-5120-25e33f71be4f-5wv7dgnIgG8@public.gmane.org>

On Tue, Jan 24, 2017 at 03:27:51PM +0000, Marc Zyngier wrote:
> On 24/01/17 15:08, Daniel Lezcano wrote:
> > On 19/01/2017 14:35, Ding Tianhong wrote:
> >> Erratum Hisilicon-161010101 says that the ARM generic timer counter "has the
> >> potential to contain an erroneous value when the timer value changes".
> >> Accesses to TVAL (both read and write) are also affected due to the implicit counter
> >> read.  Accesses to CVAL are not affected.
> >>
> >> The workaround is to reread the system count registers until the value of the second
> >> read is larger than the first one by less than 32, the system counter can be guaranteed
> >> not to return wrong value twice by back-to-back read and the error value is always larger
> >> than the correct one by 32. Writes to TVAL are replaced with an equivalent write to CVAL.
> > 
> > Why not use another clocksource instead of adding a workaround with a
> > non negligible overhead and more complexity in the code ?
> 
> The overhead only affects the affected systems, since it is guarded by a
> static key (the same static key that guards the FSL workaround that is
> already in mainline).

Yes, that is what I understood so far.
 
> As for creating a different clocksources, this would in turn make the
> integration with the arch code more complex (arm64 relies on having
> working architected timers, with or without workarounds) and the
> integration with KVM (which relies on the same), and in the end create
> quite a lot of duplication. Are we going to create a separate
> clocksource for each potential erratum that people with screwed hardware
> come up with?

That wasn't my point. The way the errata are handled in this patchset is
elegant and I have nothing against it. I'm worried about the accumulation of
fixes, hacks, workarounds in this driver. So my naive question is about not
using an identified bogus clocksource and use another one available on the
board, which is I believe often the case, instead of trying to deal with bogus
hardware. Apparently, that is not possible because 1) of KVM, 2) of duplication
and 3) of integration with the ARM64 code.

Does it mean it is not possible to use another clocksource/clockevent than the
armv8-timer ?

Can you elaborate these three points ? 

> I'd prefer to organise the mess rather than spread it everywhere.

I will add this punchline to my fortune database :)

  -- Daniel

-- 

 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-01-24 16:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 13:35 [PATCH v9 0/4] arm64: arch_timer: Add workaround for hisilicon-161010101 erratum Ding Tianhong
2017-01-19 13:35 ` [PATCH v9 2/4] arm64: arch_timer: Introduce a generic erratum handing mechanism for fsl-a008585 Ding Tianhong
     [not found]   ` <1484832916-7248-3-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-01-30 21:59     ` Daniel Lezcano
2017-01-19 13:35 ` [PATCH v9 3/4] arm64: arch_timer: Work around Erratum Hisilicon-161010101 Ding Tianhong
2017-01-30 23:17   ` Daniel Lezcano
     [not found] ` <1484832916-7248-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-01-19 13:35   ` [PATCH v9 1/4] arm64: arch_timer: Add device tree binding for hisilicon-161010101 erratum Ding Tianhong
2017-01-19 13:35   ` [PATCH v9 4/4] arm64: arch timer: Add timer erratum property for Hip05-d02 and Hip06-d03 Ding Tianhong
2017-01-19 13:49   ` [PATCH v9 0/4] arm64: arch_timer: Add workaround for hisilicon-161010101 erratum Marc Zyngier
2017-01-20  1:22     ` Ding Tianhong
2017-01-20 15:04   ` Mark Rutland
2017-01-22  7:59     ` Hanjun Guo
     [not found]       ` <8818973b-602b-e71f-a12b-3e894aa0e619-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-23 10:31         ` Mark Rutland
2017-01-23  7:36     ` Ding Tianhong
     [not found]       ` <56554f95-b51d-abc7-8ac0-7f561728375a-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-01-23  8:43         ` Marc Zyngier
2017-01-23 10:39     ` Will Deacon
2017-01-23 22:40       ` Daniel Lezcano
2017-01-24 15:08 ` Daniel Lezcano
     [not found]   ` <765699aa-cbc6-67eb-9108-cbf335338e4c-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-24 15:27     ` Marc Zyngier
     [not found]       ` <35cf654f-3944-fc76-5120-25e33f71be4f-5wv7dgnIgG8@public.gmane.org>
2017-01-24 16:35         ` Daniel Lezcano [this message]
2017-01-30 15:52           ` Mark Rutland
2017-01-30 21:54             ` Daniel Lezcano
2017-01-31 12:14               ` Mark Rutland

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=20170124163551.GB2021@mai \
    --to=daniel.lezcano-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=marc.zyngier-5wv7dgnIgG8@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=oss-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org \
    --cc=shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=stuart.yoder-3arQi8VN3Tc@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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