Skip to content
Snippets Groups Projects
  1. Sep 05, 2008
    • Jeremy Kerr's avatar
      powerpc/spufs: Fix race for a free SPU · b65fe035
      Jeremy Kerr authored
      
      We currently have a race for a free SPE. With one thread doing a
      spu_yield(), and another doing a spu_activate():
      
      thread 1				thread 2
      spu_yield(oldctx)			spu_activate(ctx)
        __spu_deactivate(oldctx)
        spu_unschedule(oldctx, spu)
        spu->alloc_state = SPU_FREE
      					spu = spu_get_idle(ctx)
      					    - searches for a SPE in
      					      state SPU_FREE, gets
      					      the context just
      					      freed by thread 1
      					spu_schedule(ctx, spu)
      					  spu->alloc_state = SPU_USED
      spu_schedule(newctx, spu)
        - assumes spu is still free
        - tries to schedule context on
          already-used spu
      
      This change introduces a 'free_spu' flag to spu_unschedule, to indicate
      whether or not the function should free the spu after descheduling the
      context. We only set this flag if we're not going to re-schedule
      another context on this SPU.
      
      Add a comment to document this behaviour.
      
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      b65fe035
    • Jeremy Kerr's avatar
      powerpc/spufs: Fix multiple get_spu_context() · 9f43e391
      Jeremy Kerr authored
      
      Commit 8d5636fb introduced a reference
      count on SPU contexts during find_victim, but this may cause a leak in
      the reference count if we later find a better contender for a context to
      unschedule.
      
      Change the reference to after we've found our victim context, so we
      don't do the extra get_spu_context().
      
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      9f43e391
  2. Sep 03, 2008
    • Kumar Gala's avatar
      powerpc: Fix for getting CPU number in power_save_ppc32_restore() · 7888bc2b
      Kumar Gala authored
      
      The calculation to get TI_CPU based off of SPRG3 was just plain wrong,
      meaning that we were getting garbage for the CPU number on 6xx/G3/G4
      based SMP boxes in this code.
      
      Just offset off the stack pointer (to get to thread_info) like all the
      other references to TI_CPU do.
      
      This was pointed out by Chen Gong <G.Chen@freescale.com>
      
      [paulus@samba.org - use rlwinm r12,r11,... instead of
       rlwinm r12,r1,...; tophys()]
      
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      7888bc2b
    • Benjamin Herrenschmidt's avatar
      powerpc: Fix build error with 64K pages and !hugetlbfs · 94ee815c
      Benjamin Herrenschmidt authored
      
      HAVE_ARCH_UNMAPPED_AREA and HAVE_ARCH_UNMAPPED_AREA_TOPDOWN must
      be defined whenever CONFIG_PPC_MM_SLICES is enabled, not just when
      CONFIG_HUGETLB_PAGE is.  They used to be always defined together but
      this is no longer the case since 3a8247cc
      ("powerpc: Only demote individual slices rather than whole process").
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      94ee815c
    • Tony Breeds's avatar
      powerpc: Work around gcc's -fno-omit-frame-pointer bug · 7563dc64
      Tony Breeds authored
      This bug is causing random crashes
      (http://bugzilla.kernel.org/show_bug.cgi?id=11414
      
      ).
      
      -fno-omit-frame-pointer is only needed on powerpc when -pg is also
      supplied, and there is a gcc bug that causes incorrect code generation
      on 32-bit powerpc when -fno-omit-frame-pointer is used---it uses stack
      locations below the stack pointer, which is not allowed by the ABI
      because those locations can and sometimes do get corrupted by an
      interrupt.
      
      This ensures that CONFIG_FRAME_POINTER is only selected by ftrace.
      When CONFIG_FTRACE is enabled we also pass -mno-sched-epilog to work
      around the gcc codegen bug.
      
      Patch based on work by:
      	Andreas Schwab <schwab@suse.de>
      	Segher Boessenkool <segher@kernel.crashing.org>
      
      Signed-off-by: default avatarTony Breeds <tony@bakeyournoodle.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      7563dc64
    • Stephen Rothwell's avatar
      powerpc: Make sure _etext is after all kernel text · 303996da
      Stephen Rothwell authored
      
      This makes core_kernel_text() (and therefore kernel_text_address())
      return the correct result.  Currently all the __devinit routines (at
      least) will not be considered to be kernel text.
      
      This is just a quick fix for 2.6.27 - hopefully we will be able to fix
      this better in 2.6.28.
      
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      303996da
    • Paul Mackerras's avatar
      powerpc: Only make kernel text pages of linear mapping executable · 9e88ba4e
      Paul Mackerras authored
      
      Commit bc033b63 ("powerpc/mm: Fix
      attribute confusion with htab_bolt_mapping()") moved the check for
      whether we should make pages of the linear mapping executable from
      htab_bolt_mapping into its callers, including htab_initialize.
      A side-effect of this is that the decision is now made once for
      each contiguous section in the LMB array rather than for each page
      individually.  This can often mean that the whole of the linear
      mapping ends up being executable.
      
      This reverts to the previous behaviour, where individual pages are
      checked for being part of the kernel text or not, by moving the check
      back down into htab_bolt_mapping.
      
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      9e88ba4e
    • Michael Neuling's avatar
      powerpc: Fix uninitialised variable in VSX alignment code · 78fbc824
      Michael Neuling authored
      
      This fixes an uninitialised variable in the VSX alignment code.  It can
      cause warnings from GCC (noticed with gcc-4.1.1).  Gcc is actually
      correct in this instance, and this bug could cause the alignment
      interrupt handler to send a SIGSEGV to the process on a legitimate
      access.
      
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      78fbc824
    • Thomas Gleixner's avatar
      [x86] Fix TSC calibration issues · fbb16e24
      Thomas Gleixner authored
      Larry Finger reported at http://lkml.org/lkml/2008/9/1/90
      
      :
      An ancient laptop of mine started throwing errors from b43legacy when
      I started using 2.6.27 on it. This has been bisected to commit bfc0f594
      "x86: merge tsc calibration".
      
      The unification of the TSC code adopted mostly the 64bit code, which
      prefers PMTIMER/HPET over the PIT calibration.
      
      Larrys system has an AMD K6 CPU. Such systems are known to have
      PMTIMER incarnations which run at double speed. This results in a
      miscalibration of the TSC by factor 0.5. So the resulting calibrated
      CPU/TSC speed is half of the real CPU speed, which means that the TSC
      based delay loop will run half the time it should run. That might
      explain why the b43legacy driver went berserk.
      
      On the other hand we know about systems, where the PIT based
      calibration results in random crap due to heavy SMI/SMM
      disturbance. On those systems the PMTIMER/HPET based calibration logic
      with SMI detection shows better results.
      
      According to Alok also virtualized systems suffer from the PIT
      calibration method.
      
      The solution is to use a more wreckage aware aproach than the current
      either/or decision.
      
      1) reimplement the retry loop which was dropped from the 32bit code
      during the merge. It repeats the calibration and selects the lowest
      frequency value as this is probably the closest estimate to the real
      frequency
      
      2) Monitor the delta of the TSC values in the delay loop which waits
      for the PIT counter to reach zero. If the maximum value is
      significantly different from the minimum, then we have a pretty safe
      indicator that the loop was disturbed by an SMI.
      
      3) keep the pmtimer/hpet reference as a backup solution for systems
      where the SMI disturbance is a permanent point of failure for PIT
      based calibration
      
      4) do the loop iteration for both methods, record the lowest value and
      decide after all iterations finished.
      
      5) Set a clear preference to PIT based calibration when the result
      makes sense.
      
      The implementation does the reference calibration based on
      HPET/PMTIMER around the delay, which is necessary for the PIT anyway,
      but keeps separate TSC values to ensure the "independency" of the
      resulting calibration values.
      
      Tested on various 32bit/64bit machines including Geode 266Mhz, AMD K6
      (affected machine with a double speed pmtimer which I grabbed out of
      the dump), Pentium class machines and AMD/Intel 64 bit boxen.
      
      Bisected-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fbb16e24
  3. Sep 02, 2008
  4. Aug 30, 2008
  5. Aug 29, 2008
  6. Aug 28, 2008
  7. Aug 27, 2008
  8. Aug 26, 2008
Loading