1. 04 4月, 2009 1 次提交
    • M
      sh: Fix up DSP context save/restore. · 01ab1039
      Michael Trimarchi 提交于
      There were a number of issues with the DSP context save/restore code,
      mostly left-over relics from when it was introduced on SH3-DSP with
      little follow-up testing, resulting in things like task_pt_dspregs()
      referencing incorrect state on the stack.
      
      This follows the MIPS convention of tracking the DSP state in the
      thread_struct and handling the state save/restore in switch_to() and
      finish_arch_switch() respectively. The regset interface is also updated,
      which allows us to finally be rid of task_pt_dspregs() and the special
      cased task_pt_regs().
      Signed-off-by: NMichael Trimarchi <michael@evidence.eu.com>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      01ab1039
  2. 22 12月, 2008 5 次提交
  3. 21 9月, 2008 2 次提交
    • P
      sh: Add FPU registers to regset interface. · e7ab3cd2
      Paul Mundt 提交于
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      e7ab3cd2
    • P
      sh: Trivial trace_mark() instrumentation for core events. · 3d58695e
      Paul Mundt 提交于
      This implements a few trace points across events that are deemed
      interesting. This implements a number of trace points:
      
      	- The page fault handler / TLB miss
      	- IPC calls
      	- Kernel thread creation
      
      The original LTTng patch had the slow-path instrumented, which
      fails to account for the vast majority of events. In general
      placing this in the fast-path is not a huge performance hit, as
      we don't take page faults for kernel addresses.
      
      The other bits of interest are some of the other trap handlers, as
      well as the syscall entry/exit (which is better off being handled
      through the tracehook API). Most of the other trap handlers are corner
      cases where alternate means of notification exist, so there is little
      value in placing extra trace points in these locations.
      
      Based on top of the points provided both by the LTTng instrumentation
      patch as well as the patch shipping in the ST-Linux tree, albeit in a
      stripped down form.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      3d58695e
  4. 08 9月, 2008 2 次提交
  5. 28 7月, 2008 1 次提交
    • A
      sh/kernel/ cleanups · 4c1cfab1
      Adrian Bunk 提交于
      This patch contains the following cleanups:
      - make the following needlessly global code static:
        - cf-enabler.c: cf_init()
        - cpu/clock.c: __clk_enable()
        - cpu/clock.c: __clk_disable()
        - process_32.c: default_idle()
        - time_32.c: struct clocksource_sh
        - timers/timer-tmu.c: struct tmu_timer_ops
      - remove the following unused functions (no CONFIG_BLK_DEV_FD on sh):
        - process_{32,64}.c: disable_hlt()
        - process_{32,64}.c: enable_hlt()
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      4c1cfab1
  6. 19 7月, 2008 1 次提交
    • T
      nohz: prevent tick stop outside of the idle loop · b8f8c3cf
      Thomas Gleixner 提交于
      Jack Ren and Eric Miao tracked down the following long standing
      problem in the NOHZ code:
      
      	scheduler switch to idle task
      	enable interrupts
      
      Window starts here
      
      	----> interrupt happens (does not set NEED_RESCHED)
      	      	irq_exit() stops the tick
      
      	----> interrupt happens (does set NEED_RESCHED)
      
      	return from schedule()
      	
      	cpu_idle(): preempt_disable();
      
      Window ends here
      
      The interrupts can happen at any point inside the race window. The
      first interrupt stops the tick, the second one causes the scheduler to
      rerun and switch away from idle again and we end up with the tick
      disabled.
      
      The fact that it needs two interrupts where the first one does not set
      NEED_RESCHED and the second one does made the bug obscure and extremly
      hard to reproduce and analyse. Kudos to Jack and Eric.
      
      Solution: Limit the NOHZ functionality to the idle loop to make sure
      that we can not run into such a situation ever again.
      
      cpu_idle()
      {
      	preempt_disable();
      
      	while(1) {
      		 tick_nohz_stop_sched_tick(1); <- tell NOHZ code that we
      		 			          are in the idle loop
      
      		 while (!need_resched())
      		       halt();
      
      		 tick_nohz_restart_sched_tick(); <- disables NOHZ mode
      		 preempt_enable_no_resched();
      		 schedule();
      		 preempt_disable();
      	}
      }
      
      In hindsight we should have done this forever, but ... 
      
      /me grabs a large brown paperbag.
      
      Debugged-by: Jack Ren <jack.ren@marvell.com>, 
      Debugged-by: Neric miao <eric.y.miao@gmail.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b8f8c3cf
  7. 26 3月, 2008 1 次提交
  8. 28 1月, 2008 4 次提交
  9. 20 10月, 2007 1 次提交
  10. 28 9月, 2007 2 次提交
  11. 31 7月, 2007 1 次提交
  12. 26 7月, 2007 1 次提交
  13. 11 6月, 2007 1 次提交
  14. 08 6月, 2007 2 次提交
  15. 21 5月, 2007 1 次提交
    • P
      sh: sr.bl toggling around idle sleep. · f3a9022f
      Paul Mundt 提交于
      As pointed out by Saito-san, without the sr.bl manipulation we can
      occasionally hit delays in the idle loop due to interrupt handling, so
      ensure that interrupts are blocked before going to sleep.
      
      At the same time, we throw in TIF_POLLING_NRFLAG for the !hlt_counter
      case (primarily used by the ST-40 parts).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      f3a9022f
  16. 09 5月, 2007 5 次提交
    • P
      sh: clockevent/clocksource/hrtimers/nohz TMU support. · 57be2b48
      Paul Mundt 提交于
      This adds basic support for clockevents and clocksources,
      presently only implemented for TMU-based systems (which
      are the majority of SH-3 and SH-4 systems).
      
      The old NO_IDLE_HZ implementation is also dropped completely,
      the only users of this were on TMU-based systems anyways.
      
      More work needs to be done to generalize the TMU handling,
      in that the current implementation is rather tied to the
      notion of TMU0 and TMU1 utilization.
      
      Additionally, as more SH timers switch over to this scheme,
      we'll be able to gut most of the remaining system timer
      infrastructure that existed before.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      57be2b48
    • P
      sh: Convert to common die chain. · b118ca57
      Paul Mundt 提交于
      This went in immediately after SH added the die chain notifiers,
      so move over to that instead..
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      b118ca57
    • P
      sh: Fix PC adjustments for varying opcode length. · 53f983a9
      Paul Mundt 提交于
      There are a few different cases for figuring out how to
      size the instruction. We read in the instruction located
      at regs->pc - 4 when rewinding the opcode to figure out if
      there's a 32-bit opcode before the faulting instruction, with
      a default of a - 2 adjustment on a mismatch. In practice this
      works for the cases where pc - 4 is just another 16-bit opcode,
      or we happen to have a 32-bit and a 16-bit immediately
      preceeding the pc value.
      
      In the cases where we aren't rewinding, this is much less ugly..
      
      We also don't bother fixing up the places where we're explicitly
      dealing with 16-bit instructions, since this might lead to
      confusion regarding the encoding size possibilities on other
      CPU variants.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      53f983a9
    • P
      sh: Support for SH-2A 32-bit opcodes. · bd079997
      Paul Mundt 提交于
      SH-2A supports both 16 and 32-bit instructions, add a simple helper
      for figuring out the instruction size in the places where there are
      hardcoded 16-bit assumptions.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      bd079997
    • P
      sh: generic quicklist support. · 5f8c9908
      Paul Mundt 提交于
      This moves SH over to the generic quicklists. As per x86_64,
      we have special mappings for the PGDs, so these go on their
      own list..
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      5f8c9908
  17. 07 5月, 2007 2 次提交
  18. 05 3月, 2007 1 次提交
  19. 13 2月, 2007 3 次提交
    • P
      sh: Fixup cpu_data references for the non-boot CPUs. · 11c19656
      Paul Mundt 提交于
      There are a lot of bogus cpu_data-> references that only end up working
      for the boot CPU, convert these to current_cpu_data to fixup SMP.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      11c19656
    • P
      sh: Use a per-cpu ASID cache. · aec5e0e1
      Paul Mundt 提交于
      Previously this was implemented using a global cache, cache
      this per-CPU instead and bump up the number of context IDs to
      match NR_CPUS.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      aec5e0e1
    • P
      sh: Use a jump call table for debug trap handlers. · f413d0d9
      Paul Mundt 提交于
      This rips out most of the needlessly complicated sh_bios and kgdb
      trap handling, and forces it all through a common fast dispatch path.
      As more debug traps are inserted, it's important to keep them in sync
      for all of the parts, not just SH-3/4.
      
      As the SH-2 parts are unable to do traps in the >= 0x40 range, we
      restrict the debug traps to the 0x30-0x3f range on all parts, and
      also bump the kgdb breakpoint trap down in to this range (from 0xff
      to 0x3c) so it's possible to use for nommu.
      
      Optionally, this table can be padded out to catch spurious traps for
      SH-3/4, but we don't do that yet..
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      f413d0d9
  20. 12 12月, 2006 2 次提交
    • P
      sh: Fix get_wchan(). · b652c23c
      Paul Mundt 提交于
      Some time ago the schedule frame size changed and we failed to reflect
      this in get_wchan() at the time. This first popped up as a problem on
      SH7751R where schedule_frame ended up being unaligned and generating
      an unaligned trap. This fixes it up again..
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      b652c23c
    • P
      sh: BUG() handling through trapa vector. · dc34d312
      Paul Mundt 提交于
      Previously we haven't been doing anything with verbose BUG() reporting,
      and we've been relying on the oops path for handling BUG()'s, which is
      rather sub-optimal.
      
      This switches BUG handling to use a fixed trapa vector (#0x3e) where we
      construct a small bug frame post trapa instruction to get the context
      right. This also makes it trivial to wire up a DIE_BUG for the atomic
      die chain, which we couldn't really do before.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      dc34d312
  21. 06 12月, 2006 1 次提交