1. 11 Sep, 2009 3 commits
    • Paul Mackerras's avatar
      powerpc: Fix bug where perf_counters breaks oprofile · a6dbf93a
      Paul Mackerras authored
      Currently there is a bug where if you use oprofile on a pSeries
      machine, then use perf_counters, then use oprofile again, oprofile
      will not work correctly; it will lose the PMU configuration the next
      time the hypervisor does a partition context switch, and thereafter
      won't count anything.
      
      Maynard Johnson identified the sequence causing the problem:
      - oprofile setup calls ppc_enable_pmcs(), which calls
        pseries_lpar_enable_pmcs, which tells the hypervisor that we want
        to use the PMU, and sets the "PMU in use" flag in the lppaca.
        This flag tells the hypervisor whether it needs to save and restore
        the PMU config.
      - The perf_counter code sets and clears the "PMU in use" flag directly
        as it context-switches the PMU between tasks, and leaves it clear
        when it finishes.
      - oprofile setup, called for a new oprofile run, calls ppc_enable_pmcs,
        which does nothing because it has already been called.  In particular
        it doesn't set the "PMU in use" flag.
      
      This fixes the problem by arranging for ppc_enable_pmcs to always set
      the "PMU in use" flag.  It makes the perf_counter code call
      ppc_enable_pmcs also rather than calling the lower-level function
      directly, and removes the setting of the "PMU in use" flag from
      pseries_lpar_enable_pmcs, since that is now done in its caller.
      
      This also removes the declaration of pasemi_enable_pmcs because it
      isn't defined anywhere.
      Reported-by: default avatarMaynard Johnson <mpjohn@us.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: <stable@kernel.org)
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a6dbf93a
    • Kumar Gala's avatar
      powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops · 757cbd46
      Kumar Gala authored
      The following commit introduced a compile error since it removed
      the implementation of smp_85xx_basic_setup:
      
      commit 77c0a700
      Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Date:   Fri Aug 28 14:25:04 2009 +1000
      
          powerpc: Properly start decrementer on BookE secondary CPUs
      
      Make it so that smp_ops probe() and setup_cpu() can be set to NULL.
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      757cbd46
    • Wolfram Sang's avatar
      powerpc/irq: Improve nanodoc · 8708d002
      Wolfram Sang authored
      The OF helpers look like nanodoc but are missing the header. Fix this and a
      typo (s/nad/and/) while we are here.
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8708d002
  2. 02 Sep, 2009 6 commits
  3. 31 Aug, 2009 6 commits
  4. 28 Aug, 2009 21 commits
  5. 27 Aug, 2009 4 commits
    • Benjamin Herrenschmidt's avatar
      3c2ee2d9
    • Gautham R Shenoy's avatar
      powerpc/pseries: Reduce the polling interval in __cpu_up() · 67764263
      Gautham R Shenoy authored
      Time time taken for a single cpu online operation on a pseries machine
      is as follows:
      Dedicated LPAR (POWER6): ~220ms.
      Shared LPAR (POWER5)   : ~240ms.
      
      Of this time, approximately 200ms is taken up by __cpu_up(). This is because
      we poll every 200ms to check if the new cpu has notified it's presence
      through the cpu_callin_map. We repeat this operation until the new cpu sets
      the value in cpu_callin_map or 5 seconds elapse, whichever comes earlier.
      
      However, using completion_structs instead of polling loops,
      the time taken by the new processor to indicate it's presence has
      found to be less than 1ms on pseries. This method however may not
      work on all powerpc platforms due to the time-base synchronization code.
      
      Keeping this in mind, we could reduce msleep polling interval from
      200ms to 1ms while retaining the 5 second timeout.
      
      With this, the time taken for a cpu online operation changes as follows:
      Dedicated LPAR (POWER6): 20-25ms.
      Shared LPAR (POWER5)   : 60-80ms.
      
      In both these cases, it was found that the code polls through the loop
      only once indicating that 1ms is a reasonable value, atleast on pseries.
      
      The code needs testing on other powerpc platforms.
      Signed-off-by: default avatarGautham R Shenoy <ego@in.ibm.com>
      Acked-by: default avatarJoel Schopp <jschopp@austin.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      67764263
    • Bastian Blank's avatar
      powerpc: Remove SMP warning from PowerMac cpufreq · 6fdc31a2
      Bastian Blank authored
      On Thu, Aug 13, 2009 at 04:14:58PM +1000, Benjamin Herrenschmidt wrote:
      > On Tue, 2009-08-11 at 11:39 +0200, Bastian Blank wrote:
      > > This patch just disables this driver on SMP kernels, as it is obviously
      > > not supported.
      > Why not remove the #error instead ? :-) I don't think it's still
      > meaningful, especially since we use the timebase for delays nowadays
      > which doesn't depend on the CPU frequency...
      
      Your call. Take this one:
      
      The build of a PowerMac 32bit kernel currently fails with
      
      error: #warning "WARNING, CPUFREQ not recommended on SMP kernels"
      
      Thie patch removes the not longer applicable SMP warning from the
      PowerMac cpufreq code.
      Signed-off-by: default avatarBastian Blank <waldi@debian.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6fdc31a2
    • Josh Boyer's avatar
      powerpc: Fix __flush_icache_range on 44x · 14d75752
      Josh Boyer authored
      The ptrace POKETEXT interface allows a process to modify the text pages of
      a child process being ptraced, usually to insert breakpoints via trap
      instructions.  The kernel eventually calls copy_to_user_page, which in turn
      calls __flush_icache_range to invalidate the icache lines for the child
      process.
      
      However, this function does not work on 44x due to the icache being virtually
      indexed.  This was noticed by a breakpoint being triggered after it had been
      cleared by ltrace on a 440EPx board.  The convenient solution is to do a
      flash invalidate of the icache in the __flush_icache_range function.
      Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      14d75752