1. 23 7月, 2014 2 次提交
    • D
      clocksource: exynos_mct: Only use 32-bits where possible · 3252a646
      Doug Anderson 提交于
      The MCT has a nice 64-bit counter.  That means that we _can_ register
      as a 64-bit clocksource and sched_clock.  ...but that doesn't mean we
      should.
      
      The 64-bit counter is read by reading two 32-bit registers.  That
      means reading needs to be something like:
      - Read upper half
      - Read lower half
      - Read upper half and confirm that it hasn't changed.
      
      That wouldn't be terrible, but:
      - THe MCT isn't very fast to access (hundreds of nanoseconds).
      - The clocksource is queried _all the time_.
      
      In total system profiles of real workloads on ChromeOS, we've seen
      exynos_frc_read() taking 2% or more of CPU time even after optimizing
      the 3 reads above to 2 (see below).
      
      The MCT is clocked at ~24MHz on all known systems.  That means that
      the 32-bit half of the counter rolls over every ~178 seconds.  This
      inspired an optimization in ChromeOS to cache the upper half between
      calls, moving 3 reads to 2.  ...but we can do better!  Having a 32-bit
      timer that flips every 178 seconds is more than sufficient for Linux.
      Let's just use the lower half of the MCT.
      
      Times on 5420 to do 1000000 gettimeofday() calls from userspace:
      * Original code:                      1323852 us
      * ChromeOS cache upper half:          1173084 us
      * ChromeOS + ldmia to optimize:       1045674 us
      * Use lower 32-bit only (this code):  1014429 us
      
      As you can see, the time used doesn't increase linearly with the
      number of reads and we can make 64-bit work almost as fast as 32-bit
      with a bit of assembly code.  But since there's no real gain for
      64-bit, let's go with the simplest and fastest implementation.
      
      Note: with this change roughly half the time for gettimeofday() is
      spent in exynos_frc_read().  The rest is timer / system call overhead.
      
      Also note: this patch disables the use of the MCT on ARM64 systems
      until we've sorted out how to make "cycles_t" always 32-bit.  Really
      ARM64 systems should be using arch timers anyway.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Acked-by Vincent Guittot <vincent.guittot@linaro.org>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      3252a646
    • D
      clocksource: exynos_mct: Use readl_relaxed/writel_relaxed · fdb06f66
      Doug Anderson 提交于
      Using the __raw functions is discouraged.  Update the file to
      consistently use the proper functions.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      fdb06f66
  2. 05 7月, 2014 2 次提交
    • A
      clocksource: exynos_mct: Register the timer for stable udelay · 8bf13a43
      Amit Daniel Kachhap 提交于
      This patch registers the exynos mct clocksource as the current timer
      as it has constant clock rate. This will generate correct udelay for
      the exynos platform and avoid using unnecessary calibrated
      jiffies. This change has been tested on exynos5420 based board and
      udelay is very close to expected.
      
      Without this patch udelay() on exynos5400 / exynos5800 is wildly
      inaccurate due to big.LITTLE not adjusting loops_per_jiffy correctly.
      Also without this patch udelay() on exynos5250 can be innacruate
      during transitions between frequencies < 800 MHz (you'll go 200 MHz ->
      800 MHz -> 300 MHz and will run at 800 MHz for a time with the wrong
      loops_per_jiffy).
      
      [dianders: reworked and created version 3]
      Signed-off-by: NAmit Daniel Kachhap <amit.daniel@samsung.com>
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      8bf13a43
    • D
      clocksource: exynos_mct: Fix ftrace · 89e6a13b
      Doug Anderson 提交于
      In (93bfb769 clocksource: exynos_mct: register sched_clock callback) we
      supported using the MCT as a scheduler clock.  We properly marked
      exynos4_read_sched_clock() as notrace.  However, we then went and
      called another function that _wasn't_ notrace.  That means if you do:
      
        cd /sys/kernel/debug/tracing/
        echo function_graph > current_tracer
      
      You'll get a crash.
      
      Fix this (but still let other readers of the MCT be trace-enabled) by
      adding an extra function.  It's important to keep other users of MCT
      traceable because the MCT is actually quite slow to access and we want
      exynos4_frc_read() to show up in ftrace profiles if it's the
      bottleneck.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      89e6a13b
  3. 16 6月, 2014 1 次提交
  4. 02 5月, 2014 1 次提交
  5. 18 4月, 2014 2 次提交
  6. 12 3月, 2014 1 次提交
  7. 14 2月, 2014 1 次提交
  8. 16 12月, 2013 1 次提交
  9. 26 9月, 2013 1 次提交
    • T
      clocksource: exynos_mct: Set IRQ affinity when the CPU goes online · 5df718d8
      Tomasz Figa 提交于
      Some variants of Exynos MCT, namely exynos4210-mct at the moment, use
      normal, shared interrupts for local timers. This means that each
      interrupt must have correct affinity set to fire only on CPU
      corresponding to given local timer.
      
      However after recent conversion of clocksource drivers to not use the
      local timer API for local timer initialization any more, the point of
      time when local timers get initialized changed and irq_set_affinity()
      fails because the CPU is not marked as online yet.
      
      This patch fixes this by moving the call to irq_set_affinity() to
      CPU_ONLINE notification, so the affinity is being set when the CPU goes
      online.
      
      This fixes a regression introduced by commit
      	ee98d27d ARM: EXYNOS4: Divorce mct from local timer API
      which rendered all Exynos4210 based boards unbootable due to
      failing irq_set_affinity() making local timers inoperatible.
      Signed-off-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Acked-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      5df718d8
  10. 15 7月, 2013 1 次提交
    • P
      clocksource+irqchip: delete __cpuinit usage from all related files · 8c37bb3a
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      This removes all the drivers/clocksource and drivers/irqchip uses of
      the __cpuinit macros from all C files.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      8c37bb3a
  11. 25 6月, 2013 1 次提交
  12. 19 6月, 2013 1 次提交
  13. 20 4月, 2013 2 次提交
  14. 04 4月, 2013 2 次提交
  15. 25 3月, 2013 2 次提交
  16. 09 3月, 2013 5 次提交
  17. 15 1月, 2013 1 次提交
  18. 13 1月, 2013 1 次提交
  19. 25 12月, 2012 1 次提交
  20. 22 11月, 2012 1 次提交
  21. 15 5月, 2012 1 次提交
  22. 14 3月, 2012 1 次提交
  23. 13 3月, 2012 1 次提交
  24. 10 3月, 2012 1 次提交
  25. 08 12月, 2011 2 次提交
  26. 06 11月, 2011 2 次提交
  27. 23 10月, 2011 1 次提交
  28. 04 10月, 2011 1 次提交