devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] arm64: arch_timer: Add workaround for hisilicon-161601 erratum
@ 2016-11-26  8:00 Ding Tianhong
  2016-11-26  8:00 ` [PATCH v4 1/6] arm64: arch_timer: Add device tree binding " Ding Tianhong
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ding Tianhong @ 2016-11-26  8:00 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, marc.zyngier, mark.rutland, oss,
	devicetree, shawnguo, stuart.yoder, linux-arm-kernel, linuxarm,
	hanjun.guo
  Cc: Ding Tianhong

Erratum Hisilicon-161601 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.

v2: Introducing a new generic erratum handling mechanism for fsl,a008585 and hisilicon,161601.
    Significant rework based on feedback, including seperate the fsl erratum a008585
    to another patch, update the erratum name and remove unwanted code.

v3: Introducing the erratum_workaround_set_sne generic function for fsl erratum a008585
    and make the #define __fsl_a008585_read_reg to be private to the .c file instead of
    being globally visible. After discussion with Marc and Will, a consensus decision was
    made to remove the commandline parameter for enabling fsl,erratum-a008585 erratum,
    and make some generic name more specific, export timer_unstable_counter_workaround
    for module access.
    
    Significant rework based on feedback, including fix some alignment problem, make the
    #define __hisi_161601_read_reg to be private to the .c file instead of being globally
    visible, add more accurate annotation and modify a bit of logical format to enable
    arch_timer_read_ool_enabled, remove the kernel commandline parameter
    clocksource.arm_arch_timer.hisilicon-161601.

    Introduce a generic aquick framework for erratum in ACPI mode.

v4: rename the quirk handler parameter to make it more generic, and
    avoid break loop when handling the quirk becasue it need to
    support multi quirks handler.

    update some data structures for acpi mode. 

Ding Tianhong (4):
  arm64: arch_timer: Add device tree binding for hisilicon-161601
    erratum
  arm64: arch_timer: Introduce a generic erratum handing mechanism for
    fsl-a008585
  arm64: arch_timer: Work around Erratum Hisilicon-161601
  arm64: arch timer: Add timer erratum property for Hip05-d02 and
    Hip06-d03

Hanjun Guo (2):
  arm64: arch_timer: apci: Introduce a generic aquirk framework for
    erratum
  arm64: arch_timer: acpi: add hisi timer errata data

 Documentation/arm64/silicon-errata.txt             |   1 +
 .../devicetree/bindings/arm/arch_timer.txt         |   8 +
 Documentation/kernel-parameters.txt                |   9 -
 arch/arm64/boot/dts/hisilicon/hip05.dtsi           |   1 +
 arch/arm64/boot/dts/hisilicon/hip06.dtsi           |   1 +
 arch/arm64/include/asm/arch_timer.h                |  38 ++--
 drivers/clocksource/Kconfig                        |   9 +
 drivers/clocksource/arm_arch_timer.c               | 197 +++++++++++++++++----
 8 files changed, 194 insertions(+), 70 deletions(-)

-- 
1.9.0

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH v4 1/6] arm64: arch_timer: Add device tree binding for hisilicon-161601 erratum
@ 2016-11-15 12:16 Ding Tianhong
       [not found] ` <1479212167-5812-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Ding Tianhong @ 2016-11-15 12:16 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, marc.zyngier, mark.rutland, oss,
	devicetree, shawnguo, stuart.yoder, linux-arm-kernel, linuxarm,
	hanjun.guo
  Cc: Ding Tianhong

This erratum describes a bug in logic outside the core, so MIDR can't be
used to identify its presence, and reading an SoC-specific revision
register from common arch timer code would be awkward.  So, describe it
in the device tree.

v2: Use the new erratum name and update the description.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/arm/arch_timer.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/arch_timer.txt b/Documentation/devicetree/bindings/arm/arch_timer.txt
index ef5fbe9..c27b2c4 100644
--- a/Documentation/devicetree/bindings/arm/arch_timer.txt
+++ b/Documentation/devicetree/bindings/arm/arch_timer.txt
@@ -31,6 +31,14 @@ to deliver its interrupts via SPIs.
   This also affects writes to the tval register, due to the implicit
   counter read.
 
+- hisilicon,erratum-161601 : A boolean property. Indicates the presence of
+  erratum 161601, which says that reading the counter is unreliable unless
+  reading twice on the register and the value of the second read is larger
+  than the first by less than 32. If the verification is unsuccessful, then
+  discard the value of this read and repeat this procedure until the verification
+  is successful.  This also affects writes to the tval register, due to the
+  implicit counter read.
+
 ** Optional properties:
 
 - arm,cpu-registers-not-fw-configured : Firmware does not initialize
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-26  8:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-26  8:00 [PATCH v4 0/6] arm64: arch_timer: Add workaround for hisilicon-161601 erratum Ding Tianhong
2016-11-26  8:00 ` [PATCH v4 1/6] arm64: arch_timer: Add device tree binding " Ding Tianhong
2016-11-26  8:00 ` [PATCH v4 2/6] arm64: arch_timer: Introduce a generic erratum handing mechanism for fsl-a008585 Ding Tianhong
2016-11-26  8:00 ` [PATCH v4 3/6] arm64: arch_timer: Work around Erratum Hisilicon-161601 Ding Tianhong
2016-11-26  8:00 ` [PATCH v4 4/6] arm64: arch timer: Add timer erratum property for Hip05-d02 and Hip06-d03 Ding Tianhong
     [not found] ` <1480147248-12828-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-11-26  8:00   ` [PATCH v4 5/6] arm64: arch_timer: apci: Introduce a generic aquirk framework for erratum Ding Tianhong
2016-11-26  8:00 ` [PATCH v4 6/6] arm64: arch_timer: acpi: add hisi timer errata data Ding Tianhong
  -- strict thread matches above, loose matches on Subject: below --
2016-11-15 12:16 [PATCH v4 1/6] arm64: arch_timer: Add device tree binding for hisilicon-161601 erratum Ding Tianhong
     [not found] ` <1479212167-5812-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-11-21 12:49   ` Ding Tianhong
     [not found]     ` <c3020c0d-bc45-2bb1-f53a-c5e76ab45499-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-11-24 12:12       ` John Garry
     [not found]         ` <624c1751-9b66-1d10-78ae-8cb4edea6109-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-11-25  1:57           ` Hanjun Guo
2016-11-25  3:18             ` Ding Tianhong

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