An error occurred fetching the project authors.
  1. 18 Dec, 2018 3 commits
    • Alexey Brodkin's avatar
      clocksource/drivers/arc_timer: Utilize generic sched_clock · bf287607
      Alexey Brodkin authored
      It turned out we used to use default implementation of sched_clock()
      from kernel/sched/clock.c which was as precise as 1/HZ, i.e.
      by default we had 10 msec granularity of time measurement.
      
      Now given ARC built-in timers are clocked with the same frequency as
      CPU cores we may get much higher precision of time tracking.
      
      Thus we switch to generic sched_clock which really reads ARC hardware
      counters.
      
      This is especially helpful for measuring short events.
      That's what we used to have:
      ------------------------------>8------------------------
      $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null
      
       Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello':
      
               10.000000      task-clock (msec)         #    2.832 CPUs utilized
                       1      context-switches          #    0.100 K/sec
                       1      cpu-migrations            #    0.100 K/sec
                      63      page-faults               #    0.006 M/sec
                 3049480      cycles                    #    0.305 GHz
                 1091259      instructions              #    0.36  insn per cycle
                  256828      branches                  #   25.683 M/sec
                   27026      branch-misses             #   10.52% of all branches
      
             0.003530687 seconds time elapsed
      
             0.000000000 seconds user
             0.010000000 seconds sys
      ------------------------------>8------------------------
      
      And now we'll see:
      ------------------------------>8------------------------
      $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null
      
       Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello':
      
                3.004322      task-clock (msec)         #    0.865 CPUs utilized
                       1      context-switches          #    0.333 K/sec
                       1      cpu-migrations            #    0.333 K/sec
                      63      page-faults               #    0.021 M/sec
                 2986734      cycles                    #    0.994 GHz
                 1087466      instructions              #    0.36  insn per cycle
                  255209      branches                  #   84.947 M/sec
                   26002      branch-misses             #   10.19% of all branches
      
             0.003474829 seconds time elapsed
      
             0.003519000 seconds user
             0.000000000 seconds sys
      ------------------------------>8------------------------
      
      Note how much more meaningful is the second output - time spent for
      execution pretty much matches number of cycles spent (we're runnign
      @ 1GHz here).
      Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      Acked-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      bf287607
    • Anson Huang's avatar
      clocksource/drivers/imx-gpt: Add support for ARM64 · df181e38
      Anson Huang authored
      This patch allows building and compile-testing the i.MX GPT driver
      also for ARM64. The delay_timer is only supported on ARMv7.
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      df181e38
    • Linus Walleij's avatar
      clocksource/drivers/ux500: Drop Ux500 custom SCHED_CLOCK · 85b6fcad
      Linus Walleij authored
      The two drivers used for Ux500 sched_clock use two Kconfig
      symbols to select which of the two gets used as sched_clock.
      
      This isn't right: the workaround is trying to make sure that
      the NONSTOP timer is used for sched_clock in order to keep
      that clock ticking consistently over a suspend/resume
      cycle. (Otherwise sched_clock simply stops during suspend
      and continues after resume).
      
      This will notably affect any timetstamped debug prints,
      so that they show the absolute number of seconds since the
      system was booted and does not loose wall-clock time during
      suspend and resume as if time stood still.
      
      The real way to fix this problem is to make sched_clock
      take advantage of any NONSTOP clock source on the system
      and adjust accordingly, not to try to work around this by
      using a different sched_clock depending on what system
      we are compiling for. This can solve the problem for
      everyone instead of providing a local solution.
      
      Cc: Baolin Wang <baolin.wang@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      85b6fcad
  2. 02 Nov, 2018 2 commits
  3. 13 Aug, 2018 1 commit
  4. 18 May, 2018 1 commit
  5. 30 Mar, 2018 1 commit
  6. 09 Mar, 2018 1 commit
  7. 23 Feb, 2018 1 commit
  8. 22 Feb, 2018 2 commits
  9. 08 Jan, 2018 2 commits
  10. 19 Oct, 2017 1 commit
    • Arnd Bergmann's avatar
      clocksource: Improve GENERIC_CLOCKEVENTS dependency · 2f8a26c1
      Arnd Bergmann authored
      We regularly run into build errors when a clocksource driver selects
      CONFIG_TIMER_OF while CONFIG_GENERIC_CLOCKEVENTS is disabled:
      
      In file included from drivers/clocksource/timer-of.c:25:0:
      drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
      
      At the moment, three drivers can show this behavior: ARMV7M_SYSTICK,
      CLKSRC_ST_LPC and CLKSRC_NPS. We could add further dependencies as we did
      many times, but I have looked a little bit more at what architectures
      are left that don't use GENERIC_CLOCKEVENTS, and this shows that there
      is a better solution.
      
      On arch/frv and arch/ia64, we never select CONFIG_GENERIC_CLOCKEVENTS
      and we also don't use ARCH_USES_GETTIMEOFFSET, which would
      block the clocksource Kconfig menu. On m68k, some platforms use
      CONFIG_GENERIC_CLOCKEVENTS, some use ARCH_USES_GETTIMEOFFSET, and some
      use neither of them. The good news is that there is no configuration that
      does not set CONFIG_GENERIC_CLOCKEVENTS but that wants to enable any of
      the Kconfig symbols in the menu, so we can simply replace the dependency
      with the stricter one. While in theory one could have a clocksource
      driver without the clockevent infrastructure, this seems unlikely
      to be relevant in the future any more.
      
      We can probably drop some of the other dependencies as well now,
      e.g. there should generally be no reason to depend on CONFIG_ARM
      unless the driver uses architecture specific assembly.
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      2f8a26c1
  11. 29 Aug, 2017 1 commit
    • Dong Aisheng's avatar
      clocksource/drivers/imx-tpm: Add imx tpm timer support · 059ab7b8
      Dong Aisheng authored
      IMX Timer/PWM Module (TPM) supports both timer and pwm function while
      this patch only adds the timer support. PWM would be added later.
      
      The TPM counter, compare and capture registers are clocked by an
      asynchronous clock that can remain enabled in low power modes.
      
      NOTE: We observed in a very small probability, the bus fabric
      contention between GPU and A7 may results a few cycles delay
      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.
      
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Anson Huang <Anson.Huang@nxp.com>
      Cc: Bai Ping <ping.bai@nxp.com>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      059ab7b8
  12. 11 Aug, 2017 1 commit
  13. 26 Jun, 2017 1 commit
  14. 18 Jun, 2017 1 commit
  15. 14 Jun, 2017 3 commits
  16. 12 Jun, 2017 2 commits
  17. 07 Apr, 2017 3 commits
    • Linus Walleij's avatar
      clocksource/drivers/gemini: Rename Gemini timer to Faraday · f5bf0ee4
      Linus Walleij authored
      After some research it turns out that the "Gemini" timer is
      actually a generic IP block from Faraday Technology named
      FTTMR010, so as to not make things too confusing we need to
      rename the driver and its symbols to make sense.
      
      The implementation remains the same in this patch but we fix
      the copy-paste error in the timer name "nomadik_mtu" as we're
      at it.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      f5bf0ee4
    • Alexander Kochetkov's avatar
      clocksource/drivers/rockchip_timer: Implement clocksource timer · 5e0a39d0
      Alexander Kochetkov authored
      The clock supplying the arm-global-timer on the rk3188 is coming from the
      the cpu clock itself and thus changes its rate everytime cpufreq adjusts
      the cpu frequency making this timer unsuitable as a stable clocksource
      and sched clock.
      
      The rk3188, rk3288 and following socs share a separate timer block already
      handled by the rockchip-timer driver. Therefore adapt this driver to also
      be able to act as clocksource and sched clock on rk3188.
      
      In order to test clocksource you can run following commands and check
      how much time it take in real. On rk3188 it take about ~45 seconds.
      
          cpufreq-set -f 1.6GHZ
          date; sleep 60; date
      
      In order to use the patch you need to declare two timers in the dts
      file. The first timer will be initialized as clockevent provider
      and the second one as clocksource. The clockevent must be from
      alive subsystem as it used as backup for the local timers at sleep
      time.
      
      The patch does not break compatibility with older device tree files.
      The older device tree files contain only one timer. The timer
      will be initialized as clockevent, as expected.
      
      rk3288 (and probably anything newer) is irrelevant to this patch,
      as it has the arch timer interface. This patch may be useful
      for Cortex-A9/A5 based parts.
      Signed-off-by: default avatarAlexander Kochetkov <al.kochet@gmail.com>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      5e0a39d0
    • Marc Zyngier's avatar
      arm64: arch_timer: Workaround for Cortex-A73 erratum 858921 · fa8d815f
      Marc Zyngier authored
      Cortex-A73 (all versions) counter read can return a wrong value
      when the counter crosses a 32bit boundary.
      
      The workaround involves performing the read twice, and to return
      one or the other depending on whether a transition has taken place.
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      fa8d815f
  18. 07 Feb, 2017 5 commits
    • Ding Tianhong's avatar
      clocksource/drivers/arm_arch_timer: Work around Hisilicon erratum 161010101 · bb42ca47
      Ding Tianhong authored
      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.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      [Mark: split patch, fix Kconfig, reword commit message]
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      bb42ca47
    • Ding Tianhong's avatar
      clocksource/drivers/arm_arch_timer: Introduce generic errata handling infrastructure · 16d10ef2
      Ding Tianhong authored
      Currently we have code inline in the arch timer probe path to cater for
      Freescale erratum A-008585, complete with ifdeffery. This is a little
      ugly, and will get worse as we try to add more errata handling.
      
      This patch refactors the handling of Freescale erratum A-008585. Now the
      erratum is described in a generic arch_timer_erratum_workaround
      structure, and the probe path can iterate over these to detect errata
      and enable workarounds.
      
      This will simplify the addition and maintenance of code handling
      Hisilicon erratum 161010101.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      [Mark: split patch, correct Kconfig, reword commit message]
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      16d10ef2
    • Chris Brandt's avatar
      clocksource/drivers/ostm: Add renesas-ostm timer driver · fb6002a8
      Chris Brandt authored
      This patch adds a OSTM driver for the Renesas architecture.
      The OS Timer (OSTM) has independent channels that can be
      used as a freerun or interval times.
      This driver uses the first probed device as a clocksource
      and then any additional devices as clock events.
      Signed-off-by: default avatarChris Brandt <chris.brandt@renesas.com>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      fb6002a8
    • Linus Walleij's avatar
      clocksource/drivers/gemini: Add driver for the Cortina Gemini · 4750535b
      Linus Walleij authored
      This is a rewrite of the Gemini timer
      driver in arch/arm/mach-gemini/timer.c trying to do everything
      the device tree way:
      
      - Make every IO-access relative to a base address and dynamic
        so we can do a dynamic ioremap and get going.
      - Do not poke around directly in the global syscon registers,
        access them using the syscon regmap style design pattern for
        the one register we need to check.
      - Find register range and interrupt from the device tree.
      
      Cc: Janos Laube <janos.dev@gmail.com>
      Cc: Paulius Zaleckas <paulius.zaleckas@gmail.com>
      Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      4750535b
    • Daniel Lezcano's avatar
      clockevents: Add a clkevt-of mechanism like clksrc-of · 376bc271
      Daniel Lezcano authored
      The current code uses the CLOCKSOURCE_OF_DECLARE macro to fill the clksrc
      table with a t-uple (name, init_function).
      
      Unfortunately it ends up to the clockevent and the clocksource being
      both initialized with this macro. It is not a problem by itself but there
      is not a clear distinction between a clockevent and a clocksource in the
      code initialization path. Somebody can argue there are the same IP block
      and the same DT node. But conceptually from the software side, there are
      two distincts entities and as is they should be initialized separetely.
      Some drivers which do not have a clocksource end up by using the
      CLOCKSOURCE_OF_DECLARE macro to declare a clockevent.
      
      Another result is the fuzzy organization in the clocksource directory,
      where the clockevents are implemented in the same file than the
      clocksources or file labelled timer-something implementing a clocksource.
      
      This patch provides another macro to specifically declare a clockevent in
      the same way than the clocksource and gives the opportunity to write two
      separate drivers, one for the clocksource and another for the clockevents.
      
      Hopefully, that can help to do some housework in the directory, perhaps
      split the drivers in to entities, for example:
      	- clksrc-rockchip.c
      	- clkevt-rockchip.c
      
      Also, it gives the possibility to declare clocksources separately in the
      DT and then use a clocksource from IP block while while clockevents are
      used from another IP block.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      376bc271
  19. 30 Nov, 2016 1 commit
  20. 20 Oct, 2016 1 commit
    • Rich Felker's avatar
      clocksource: Add J-Core timer/clocksource driver · 9995f4f1
      Rich Felker authored
      At the hardware level, the J-Core PIT is integrated with the interrupt
      controller, but it is represented as its own device and has an
      independent programming interface. It provides a 12-bit countdown
      timer, which is not presently used, and a periodic timer. The interval
      length for the latter is programmable via a 32-bit throttle register
      whose units are determined by a bus-period register. The periodic
      timer is used to implement both periodic and oneshot clock event
      modes; in oneshot mode the interrupt handler simply disables the timer
      as soon as it fires.
      
      Despite its device tree node representing an interrupt for the PIT,
      the actual irq generated is programmable, not hard-wired. The driver
      is responsible for programming the PIT to generate the hardware irq
      number that the DT assigns to it.
      
      On SMP configurations, J-Core provides cpu-local instances of the PIT;
      no broadcast timer is needed. This driver supports the creation of the
      necessary per-cpu clock_event_device instances.
      
      A nanosecond-resolution clocksource is provided using the J-Core "RTC"
      registers, which give a 64-bit seconds count and 32-bit nanoseconds
      that wrap every second. The driver converts these to a full-range
      32-bit nanoseconds count.
      Signed-off-by: default avatarRich Felker <dalias@libc.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Link: http://lkml.kernel.org/r/b591ff12cc5ebf63d1edc98da26046f95a233814.1476393790.git.dalias@libc.orgSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      9995f4f1
  21. 23 Sep, 2016 1 commit
    • Scott Wood's avatar
      arm64: arch_timer: Work around QorIQ Erratum A-008585 · f6dc1576
      Scott Wood authored
      Erratum A-008585 says that the ARM generic timer counter "has the
      potential to contain an erroneous value for a small number of core
      clock cycles every time 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 TVAL and count registers until successive
      reads return the same value.  Writes to TVAL are replaced with an
      equivalent write to CVAL.
      
      The workaround is to reread TVAL and count registers until successive reads
      return the same value, and when writing TVAL to retry until counter
      reads before and after the write return the same value.
      
      The workaround is enabled if the fsl,erratum-a008585 property is found in
      the timer node in the device tree.  This can be overridden with the
      clocksource.arm_arch_timer.fsl-a008585 boot parameter, which allows KVM
      users to enable the workaround until a mechanism is implemented to
      automatically communicate this information.
      
      This erratum can be found on LS1043A and LS2080A.
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarScott Wood <oss@buserror.net>
      [will: renamed read macro to reflect that it's not usually unstable]
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      f6dc1576
  22. 16 Sep, 2016 1 commit
  23. 28 Jun, 2016 4 commits