Skip to contentSkip to conversation

sh arch support for 2.6.28-rt

PATCH Applied Katsuya Matsubara 2 participants 6 messages Feb 11, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

cover sh arch support for 2.6.28-rt

These patches apply preempt-rt treatments into sh specific code. 64 bit support is not included because I have no sh64 board. These are based on the 2.6.28-rt git.

I made sure that these work on renesas rts7751r2dplus.

-- Katsuya Matsubara / [email protected]

---

Katsuya Matsubara (4):
sh: use __preempt_enable_no_resched in cpu_idle()
sh: enable interrupts in signal handling
sh: decouple the pagefault-disabled logic
convert-locks-list: add sh specific spin locks

 arch/sh/kernel/process_32.c |    2 +-
 arch/sh/kernel/signal_32.c  |    7 +++++++
 arch/sh/mm/fault_32.c       |    2 +-
 scripts/convert-locks-list  |   12 ++++++++++++
 4 files changed, 21 insertions(+), 2 deletions(-)
#1 lore raw
Quoted 8 lines · Katsuya Matsubara

These patches apply preempt-rt treatments into sh specific code. 64 bit support is not included because I have no sh64 board. These are based on the 2.6.28-rt git.

I made sure that these work on renesas rts7751r2dplus.

-- Katsuya Matsubara / [email protected]

Quoted 7 lines

---

Katsuya Matsubara (4):
sh: use __preempt_enable_no_resched in cpu_idle()
sh: enable interrupts in signal handling
sh: decouple the pagefault-disabled logic
convert-locks-list: add sh specific spin locks

Applied. Thanks!

-- Steve

#2 lore raw

PATCH 1/4 sh: use __preempt_enable_no_resched in cpu_idle()

In reply to Katsuya Matsubara

__preempt_enable_no_resched skips preempt_count check. However it is of no matter since schedule is called afterwards in this case. The same was done for arm in <http://lkml.org/lkml/2009/2/2/291>.

---
 arch/sh/kernel/process_32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sh/kernel/process_32.c +1 -1
index b965f02..483fe78 100644
@@ -84,7 +84,7 @@ void cpu_idle(void)
 			idle();
 		tick_nohz_restart_sched_tick();
 
-		preempt_enable_no_resched();
+		__preempt_enable_no_resched();
 		schedule();
 		preempt_disable();
 		check_pgt_cache();
Signature · 1 line
1.6.1
#3 lore raw

PATCH 2/4 sh: enable interrupts in signal handling

Fully-preemptible kernel does not need interrupts disabled in signal handling. The same treatment can be found in x86 and arm code.

---
 arch/sh/kernel/signal_32.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/sh/kernel/signal_32.c +7 -0
index 6d6e408..9f633b5 100644
@@ -571,6 +571,13 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
 	struct k_sigaction ka;
 	sigset_t *oldset;
 
+#ifdef CONFIG_PREEMPT_RT
+	/*
+	* Fully-preemptible kernel does not need interrupts disabled:
+	*/
+	local_irq_enable();
+	preempt_check_resched();
+#endif
 	/*
 	 * We want the common case to go fast, which
 	 * is why we may in certain cases get here from
Signature · 1 line
1.6.1
#4 lore raw

PATCH 3/4 sh: decouple the pagefault-disabled logic

The preempt-rt patch adds a pagefault-disabled logic. We must not take page faults if pagefault_disabled > 0. The same treatment can be found in other arch code.

---
 arch/sh/mm/fault_32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sh/mm/fault_32.c +1 -1
index 898d477..2746b08 100644
@@ -100,7 +100,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
 	 * If we're in an interrupt or have no user
 	 * context, we must not take the fault..
 	 */
-	if (in_atomic() || !mm)
+	if (in_atomic() || !mm || current->pagefault_disabled)
 		goto no_context;
 
 	down_read(&mm->mmap_sem);
Signature · 1 line
1.6.1
#5 lore raw

PATCH 4/4 convert-locks-list: add sh specific spin locks

The preempt-rt converts all spin locks into sleepable locks. However some of the locks, for example, used in preempt-disabled code, must keep the original behavior. The convert-locks script can revert such locks specified by convert-locks-list. This patch add sh specific spin locks into the list.

---
 scripts/convert-locks-list |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
scripts/convert-locks-list +12 -0
index daba5a8..44793fb 100644
@@ -84,6 +84,18 @@ arch/powerpc/include/asm/mpic.h:fixup_lock
 arch/powerpc/include/asm/rtas.h:lock
 arch/powerpc/include/asm/rwsem.h:wait_lock
 
+arch/sh/kernel/irq.c:(.*)lock
+arch/sh/kernel/traps_32.c:die_lock
+arch/sh/kernel/io_trapped.c:trapped_lock
+arch/sh/kernel/cpu/sh4/sq.c:sq_mapping_lock
+arch/sh/kernel/cpu/clock.c:clock_lock
+arch/sh/drivers/pci/ops-sh4.c:sh4_pci_lock
+arch/sh/mm/pmb.c:pmb_list_lock
+
+arch/sh/include/asm/dma.h:dma_spin_lock
+arch/sh/drivers/dma/dma-api.c:dma_spin_lock
+arch/sh/drivers/dma/dma-isa.c:dma_spin_lock
+
 arch/mips/kernel/i8259.c:i8259A_lock
 arch/mips/kernel/module.c:dbe_lock
 arch/mips/kernel/smp.c:smp_call_lock
Signature · 1 line
1.6.1