1. 13 6月, 2013 1 次提交
  2. 20 4月, 2013 1 次提交
    • S
      ARM: 7699/1: sched_clock: Add more notrace to prevent recursion · cea15092
      Stephen Boyd 提交于
      cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
      is called by cyc_to_sched_clock(). I suspect that some compilers
      inline both of these functions into sched_clock() and so we've
      been getting away without having a notrace marking. It seems that
      my compiler isn't inlining cyc_to_sched_clock() though, so I'm
      hitting a recursion bug when I enable the function graph tracer,
      causing my system to crash. Marking these functions notrace fixes
      it. Technically cyc_to_ns() doesn't need the notrace because it's
      already marked inline, but let's just add it so that if we ever
      remove inline from that function it doesn't blow up.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      cea15092
  3. 11 4月, 2013 2 次提交
  4. 12 2月, 2013 1 次提交
    • J
      ARM: 7643/1: sched: correct update_sched_clock() · 7c4e9ced
      Joonsoo Kim 提交于
      If we want load epoch_cyc and epoch_ns atomically,
      we should update epoch_cyc_copy first of all.
      This notify reader that updating is in progress.
      
      If we update epoch_cyc first like as current implementation,
      there is subtle error case.
      Look at the below example.
      
      <Initial Condition>
      cyc = 9
      ns = 900
      cyc_copy = 9
      
      == CASE 1 ==
      <CPU A = reader>           <CPU B = updater>
                                 write cyc = 10
      read cyc = 10
      read ns = 900
                                 write ns = 1000
                                 write cyc_copy = 10
      read cyc_copy = 10
      
      output = (10, 900)
      
      == CASE 2 ==
      <CPU A = reader>           <CPU B = updater>
      read cyc = 9
                                 write cyc = 10
                                 write ns = 1000
      read ns = 1000
      read cyc_copy = 9
                                 write cyc_copy = 10
      output = (9, 1000)
      
      If atomic read is ensured, output should be (9, 900) or (10, 1000).
      But, output in example case are not.
      
      So, change updating sequence in order to correct this problem.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7c4e9ced
  5. 29 10月, 2012 1 次提交
    • F
      ARM: 7565/1: sched: stop sched_clock() during suspend · 6a4dae5e
      Felipe Balbi 2 提交于
      The scheduler imposes a requirement to sched_clock()
      which is to stop the clock during suspend, if we don't
      do that any RT thread will be rescheduled in the future
      which might cause any sort of problems.
      
      This became an issue on OMAP when we converted omap-i2c.c
      to use threaded IRQs, it turned out that depending on how
      much time we spent on suspend, the I2C IRQ thread would
      end up being rescheduled so far in the future that I2C
      transfers would timeout and, because omap_hsmmc depends
      on an I2C-connected device to detect if an MMC card is
      inserted in the slot, our rootfs would just vanish.
      
      arch/arm/kernel/sched_clock.c already had an optional
      implementation (sched_clock_needs_suspend()) which would
      handle scheduler's requirement properly, what this patch
      does is simply to make that implementation non-optional.
      
      Note that this has the side-effect that printk timings
      won't reflect the actual time spent on suspend so other
      methods to measure that will have to be used.
      
      This has been tested with beagleboard XM (OMAP3630) and
      pandaboard rev A3 (OMAP4430). Suspend to RAM is now working
      after this patch.
      
      Thanks to Kevin Hilman for helping out with debugging.
      Acked-by: NKevin Hilman <khilman@ti.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6a4dae5e
  6. 16 9月, 2012 1 次提交
    • R
      ARM: Add irqtime accounting support · a42c3629
      Russell King 提交于
      Add support for irq time accounting.  This commit prepares ARM by adding
      the call to enable_sched_clock_irqtime() in sched_clock().  We introduce
      a new kernel parameter - irqtime - which takes an integer.  -1 for auto,
      0 for disabled, and 1 for enabled.  Auto mode selects IRQ accounting if
      we have a sched_clock() tick rate greater than 1MHz.
      
      Frederic Weisbecker is working on a patch set which moves the
      IRQ_TIME_ACCOUNTING into arch/, so that part is not incorporated into
      this patch; this facility becomes available on ARM only when both this
      patch and Frederic's patches are merged.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      a42c3629
  7. 11 8月, 2012 1 次提交
    • C
      ARM: 7486/1: sched_clock: update epoch_cyc on resume · 237ec6f2
      Colin Cross 提交于
      Many clocks that are used to provide sched_clock will reset during
      suspend.  If read_sched_clock returns 0 after suspend, sched_clock will
      appear to jump forward.  This patch resets cd.epoch_cyc to the current
      value of read_sched_clock during resume, which causes sched_clock() just
      after suspend to return the same value as sched_clock() just before
      suspend.
      
      In addition, during the window where epoch_ns has been updated before
      suspend, but epoch_cyc has not been updated after suspend, it is unknown
      whether the clock has reset or not, and sched_clock() could return a
      bogus value.  Add a suspended flag, and return the pre-suspend epoch_ns
      value during this period.
      
      The new behavior is triggered by calling setup_sched_clock_needs_suspend
      instead of setup_sched_clock.
      Signed-off-by: NColin Cross <ccross@android.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      237ec6f2
  8. 24 3月, 2012 1 次提交
  9. 19 12月, 2011 1 次提交
  10. 12 1月, 2011 2 次提交
    • R
      ARM: sched_clock: make minsec argument to clocks_calc_mult_shift() zero · edc4d272
      Russell King 提交于
      The purpose of the minsec argument is to prevent 64-bit math overflow
      when the number of cycles is multiplied up.  However, the multipler
      is 32-bit, and in the sched_clock() case, the cycle counter is up to
      32-bit as well.  So the math can never overflow.
      
      With a value of 60, and clock rates greater than 71MHz, the calculated
      multiplier is unnecessarily reduced in value, which reduces accuracy by
      maybe 70ppt.  It's almost not worth bothering with as the oscillator
      driving the counter won't be any more than 1ppm - unless you're using
      a rubidium lamp or caesium fountain frequency standard.
      
      So, set the minsec argument to zero.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      edc4d272
    • R
      ARM: sched_clock: allow init_sched_clock() to be called early · 211baa70
      Russell King 提交于
      sched_clock is supposed to be initialized early - in the recently added
      init_early platform hook.  However, in doing so we end up calling
      mod_timer() before the timer lists are initialized, resulting in an
      oops.
      
      Split the initialization in two - the part which the platform calls
      early which starts things off.  The addition of the timer can be
      delayed until after we have more of the kernel initialized - when the
      normal time sources are initialized.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      211baa70
  11. 23 12月, 2010 1 次提交