1. 29 7月, 2010 1 次提交
    • P
      powerpc: Clean up obsolete code relating to decrementer and timebase · d75d68cf
      Paul Mackerras 提交于
      Since the decrementer and timekeeping code was moved over to using
      the generic clockevents and timekeeping infrastructure, several
      variables and functions have been obsolete and effectively unused.
      This deletes them.
      
      In particular, wakeup_decrementer() is no longer needed since the
      generic code reprograms the decrementer as part of the process of
      resuming the timekeeping code, which happens during sysdev resume.
      Thus the wakeup_decrementer calls in the suspend_enter methods for
      52xx platforms have been removed.  The call in the powermac cpu
      frequency change code has been replaced by set_dec(1), which will
      cause a timer interrupt as soon as interrupts are enabled, and the
      generic code will then reprogram the decrementer with the correct
      value.
      
      This also simplifies the generic_suspend_en/disable_irqs functions
      and makes them static since they are not referenced outside time.c.
      The preempt_enable/disable calls are removed because the generic
      code has disabled all but the boot cpu at the point where these
      functions are called, so we can't be moved to another cpu.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d75d68cf
  2. 06 11月, 2008 1 次提交
  3. 04 8月, 2008 1 次提交
  4. 14 5月, 2008 1 次提交
    • M
      [POWERPC] Fix sparse warnings in arch/powerpc/kernel · 1c21a293
      Michael Ellerman 提交于
      Make a few things static in lparcfg.c
      Make init and exit routines static in rtas_flash.c
      Make things static in rtas_pci.c
      Make some functions static in rtas.c
      Make fops static in rtas-proc.c
      Remove unneeded extern for do_gtod in smp.c
      Make clocksource_init() static in time.c
      Make last_tick_len and ticklen_to_xs static in time.c
      Move the declaration of the pvr per-cpu into smp.h
      Make kexec_smp_down() and kexec_stack static in machine_kexec_64.c
      Don't return void in arch_teardown_msi_irqs() in msi.c
      Move declaration of GregorianDay()into asm/time.h
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1c21a293
  5. 06 12月, 2007 1 次提交
    • T
      [POWERPC] Fix hardware IRQ time accounting problem. · 81a3843f
      Tony Breeds 提交于
      The commit fa13a5a1 (sched: restore
      deterministic CPU accounting on powerpc), unconditionally calls
      update_process_tick() in system context.  In the deterministic
      accounting case this is the correct thing to do.  However, in the
      non-deterministic accounting case we need to not do this, since doing
      this results in the time accounted as hardware irq time being
      artificially elevated.
      
      Also this collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
      checks in time.h into one for neatness.
      Signed-off-by: NTony Breeds <tony@bakeyournoodle.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      81a3843f
  6. 08 11月, 2007 1 次提交
    • P
      [POWERPC] Fix off-by-one error in setting decrementer on Book E/4xx (v2) · 43875cc0
      Paul Mackerras 提交于
      The decrementer in Book E and 4xx processors interrupts on the
      transition from 1 to 0, rather than on the 0 to -1 transition as on
      64-bit server and 32-bit "classic" (6xx/7xx/7xxx) processors.  At the
      moment we subtract 1 from the count of how many decrementer ticks are
      required before the next interrupt before putting it into the
      decrementer, which is correct for server/classic processors, but could
      possibly cause the interrupt to happen too early on Book E and 4xx if
      the timebase/decrementer frequency is low.
      
      This fixes the problem by making set_dec subtract 1 from the count for
      server and classic processors, instead of having the callers subtract
      1.  Since set_dec already had a bunch of ifdefs to handle different
      processor types, there is no net increase in ugliness. :)
      
      Note that calling set_dec(0) may not generate an interrupt on some
      processors.  To make sure that decrementer_set_next_event always calls
      set_dec with an interval of at least 1 tick, we set min_delta_ns of
      the decrementer_clockevent to correspond to 2 ticks (2 rather than 1
      to compensate for truncations in the conversions between ticks and
      ns).
      
      This also removes a redundant call to set the decrementer to
      0x7fffffff - it was already set to that earlier in timer_interrupt.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      43875cc0
  7. 03 10月, 2007 1 次提交
  8. 19 9月, 2007 1 次提交
  9. 20 8月, 2007 1 次提交
  10. 28 6月, 2007 1 次提交
    • T
      [POWERPC] Move iSeries_tb_recal into its own late_initcall. · 71712b45
      Tony Breeds 提交于
      Currently iSeries will recalibrate the cputime_factors in the first
      settimeofday() call.
      
      It seems the reason for doing this is to ensure a resaonable time delta after
      time_init().  On current kernels (with udev), this call is made 40-60 seconds
      into the boot process, by moving it to a late initcall it is called
      approximately 5 seconds after time_init() is called.  This is sufficient to
      recalibrate the timebase.
      Signed-off-by: NTony Breeds <tony@bakeyournoodle.com>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      71712b45
  11. 25 6月, 2007 1 次提交
  12. 07 2月, 2007 1 次提交
  13. 22 11月, 2006 1 次提交
  14. 25 10月, 2006 1 次提交
  15. 02 10月, 2006 1 次提交
  16. 31 8月, 2006 1 次提交
  17. 30 8月, 2006 1 次提交
    • P
      [POWERPC] Fix problem with time not advancing on 32-bit platforms · e0d872d5
      Paul Mackerras 提交于
      This fixes a problem introduced in 5db9fa95.
      The last_jiffy per-cpu variable is only 32 bits on 32-bit machines, but it
      was being compared with a 64-bit quantity (tb_next_jiffy), which resulted in
      time not advancing.
      
      This fixes it by changing last_jiffy to be 64 bits on all platforms.  With
      this, we no longer need tb_last_stamp as a 32-bit version of tb_last_jiffy,
      so this gets rid of tb_last_stamp and we just use tb_last_jiffy instead.
      This also fixes a bug when the boot cpu is not online, because using
      tb_last_stamp could have caused the wrong timebase origin value to be used
      when calculating the time of day.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e0d872d5
  18. 28 6月, 2006 1 次提交
  19. 26 4月, 2006 1 次提交
  20. 24 2月, 2006 1 次提交
    • P
      powerpc: Implement accurate task and CPU time accounting · c6622f63
      Paul Mackerras 提交于
      This implements accurate task and cpu time accounting for 64-bit
      powerpc kernels.  Instead of accounting a whole jiffy of time to a
      task on a timer interrupt because that task happened to be running at
      the time, we now account time in units of timebase ticks according to
      the actual time spent by the task in user mode and kernel mode.  We
      also count the time spent processing hardware and software interrupts
      accurately.  This is conditional on CONFIG_VIRT_CPU_ACCOUNTING.  If
      that is not set, we do tick-based approximate accounting as before.
      
      To get this accurate information, we read either the PURR (processor
      utilization of resources register) on POWER5 machines, or the timebase
      on other machines on
      
      * each entry to the kernel from usermode
      * each exit to usermode
      * transitions between process context, hard irq context and soft irq
        context in kernel mode
      * context switches.
      
      On POWER5 systems with shared-processor logical partitioning we also
      read both the PURR and the timebase at each timer interrupt and
      context switch in order to determine how much time has been taken by
      the hypervisor to run other partitions ("steal" time).  Unfortunately,
      since we need values of the PURR on both threads at the same time to
      accurately calculate the steal time, and since we can only calculate
      steal time on a per-core basis, the apportioning of the steal time
      between idle time (time which we ceded to the hypervisor in the idle
      loop) and actual stolen time is somewhat approximate at the moment.
      
      This is all based quite heavily on what s390 does, and it uses the
      generic interfaces that were added by the s390 developers,
      i.e. account_system_time(), account_user_time(), etc.
      
      This patch doesn't add any new interfaces between the kernel and
      userspace, and doesn't change the units in which time is reported to
      userspace by things such as /proc/stat, /proc/<pid>/stat, getrusage(),
      times(), etc.  Internally the various task and cpu times are stored in
      timebase units, but they are converted to USER_HZ units (1/100th of a
      second) when reported to userspace.  Some precision is therefore lost
      but there should not be any accumulating error, since the internal
      accumulation is at full precision.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      c6622f63
  21. 13 1月, 2006 1 次提交
    • D
      [PATCH] powerpc: Remove lppaca structure from the PACA · 3356bb9f
      David Gibson 提交于
      At present the lppaca - the structure shared with the iSeries
      hypervisor and phyp - is contained within the PACA, our own low-level
      per-cpu structure.  This doesn't have to be so, the patch below
      removes it, making a separate array of lppaca structures.
      
      This saves approximately 500*NR_CPUS bytes of image size and kernel
      memory, because we don't need aligning gap between the Linux and
      hypervisor portions of every PACA.  On the other hand it means an
      extra level of dereference in many accesses to the lppaca.
      
      The patch also gets rid of several places where we assign the paca
      address to a local variable for no particular reason.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3356bb9f
  22. 01 11月, 2005 1 次提交
  23. 23 10月, 2005 1 次提交
    • P
      powerpc: Fix time code for 601 processors · 96c44507
      Paul Mackerras 提交于
      The 601 doesn't have the timebase register; instead it has an RTCL
      register that counts nanoseconds and wraps at 1000000000, and an
      RTCU register that counts seconds.  This makes the necessary changes
      for the merged time code to use the RTCL/U registers when the kernel
      is running on a 601.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      96c44507
  24. 22 10月, 2005 1 次提交
  25. 20 10月, 2005 2 次提交