diff options
| author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-09-05 01:42:16 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-05 01:42:16 -0400 |
| commit | 323b8c410a2453f15578c22b0eef50456359bbfc (patch) | |
| tree | da216c011548831a3448da414732e94de81a6c43 | |
| parent | 3c31bf73134038a417a9ae3fa3c02c279b42c550 (diff) | |
sh: resume_kernel fix for kernel oops built with CONFIG_BKL_PREEMPT=y.
This patch fixes a problem within the SH implementation of resume_kernel code,
that implements in assembly the bulk of preempt_schedule_irq function without
taking care of the extra code needed to handle the BKL preemptible.
The patch basically consists of removing this asm code and calling the common
C implementation (see kernel/sched.c) as other archs do.
Another change is the missing 'cli' macro invocation at the beginning of
the resume_kernel.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| -rw-r--r-- | arch/sh/kernel/entry-common.S | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 0bc17def55a7..efbb4268875e 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
| @@ -92,6 +92,7 @@ ENTRY(ret_from_irq) | |||
| 92 | bra resume_userspace | 92 | bra resume_userspace |
| 93 | nop | 93 | nop |
| 94 | ENTRY(resume_kernel) | 94 | ENTRY(resume_kernel) |
| 95 | cli | ||
| 95 | mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count | 96 | mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count |
| 96 | tst r0, r0 | 97 | tst r0, r0 |
| 97 | bf noresched | 98 | bf noresched |
| @@ -105,28 +106,9 @@ need_resched: | |||
| 105 | and #0xf0, r0 ! interrupts off (exception path)? | 106 | and #0xf0, r0 ! interrupts off (exception path)? |
| 106 | cmp/eq #0xf0, r0 | 107 | cmp/eq #0xf0, r0 |
| 107 | bt noresched | 108 | bt noresched |
| 108 | |||
| 109 | mov.l 1f, r0 | ||
| 110 | mov.l r0, @(TI_PRE_COUNT,r8) | ||
| 111 | |||
| 112 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
| 113 | mov.l 3f, r0 | 109 | mov.l 3f, r0 |
| 114 | jsr @r0 | 110 | jsr @r0 ! call preempt_schedule_irq |
| 115 | nop | ||
| 116 | #endif | ||
| 117 | sti | ||
| 118 | mov.l 2f, r0 | ||
| 119 | jsr @r0 | ||
| 120 | nop | ||
| 121 | mov #0, r0 | ||
| 122 | mov.l r0, @(TI_PRE_COUNT,r8) | ||
| 123 | cli | ||
| 124 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
| 125 | mov.l 4f, r0 | ||
| 126 | jsr @r0 | ||
| 127 | nop | 111 | nop |
| 128 | #endif | ||
| 129 | |||
| 130 | bra need_resched | 112 | bra need_resched |
| 131 | nop | 113 | nop |
| 132 | 114 | ||
| @@ -137,10 +119,7 @@ noresched: | |||
| 137 | .align 2 | 119 | .align 2 |
| 138 | 1: .long PREEMPT_ACTIVE | 120 | 1: .long PREEMPT_ACTIVE |
| 139 | 2: .long schedule | 121 | 2: .long schedule |
| 140 | #ifdef CONFIG_TRACE_IRQFLAGS | 122 | 3: .long preempt_schedule_irq |
| 141 | 3: .long trace_hardirqs_on | ||
| 142 | 4: .long trace_hardirqs_off | ||
| 143 | #endif | ||
| 144 | #endif | 123 | #endif |
| 145 | 124 | ||
| 146 | ENTRY(resume_userspace) | 125 | ENTRY(resume_userspace) |
