lkml.org 
[lkml]   [2005]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 2.6.14-rc2-mm2] m32r: Fix smp.c for preempt kernel
From
This patch fixes the following BUG message of arch/m32r/smp.c
for CONFIG_DEBUG_PREEMPT:

BUG: using smp_processor_id() in preemptible

This message is displayed by an smp_processor_id() execution during
kernel's preemptible-state.

Signed-off-by: Hitoshi Yamamoto <hitoshiy@isl.melco.co.jp>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---

arch/m32r/kernel/smp.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

Index: linux-2.6.14-rc2-mm2/arch/m32r/kernel/smp.c
===================================================================
--- linux-2.6.14-rc2-mm2.orig/arch/m32r/kernel/smp.c 2005-09-20 12:00:41.000000000 +0900
+++ linux-2.6.14-rc2-mm2/arch/m32r/kernel/smp.c 2005-10-11 21:21:50.819863288 +0900
@@ -275,12 +275,14 @@ static void flush_tlb_all_ipi(void *info
*==========================================================================*/
void smp_flush_tlb_mm(struct mm_struct *mm)
{
- int cpu_id = smp_processor_id();
+ int cpu_id;
cpumask_t cpu_mask;
- unsigned long *mmc = &mm->context[cpu_id];
+ unsigned long *mmc;
unsigned long flags;

preempt_disable();
+ cpu_id = smp_processor_id();
+ mmc = &mm->context[cpu_id];
cpu_mask = mm->cpu_vm_mask;
cpu_clear(cpu_id, cpu_mask);

@@ -343,12 +345,14 @@ void smp_flush_tlb_range(struct vm_area_
void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
{
struct mm_struct *mm = vma->vm_mm;
- int cpu_id = smp_processor_id();
+ int cpu_id;
cpumask_t cpu_mask;
- unsigned long *mmc = &mm->context[cpu_id];
+ unsigned long *mmc;
unsigned long flags;

preempt_disable();
+ cpu_id = smp_processor_id();
+ mmc = &mm->context[cpu_id];
cpu_mask = mm->cpu_vm_mask;
cpu_clear(cpu_id, cpu_mask);

--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project: http://www.linux-m32r.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-10-11 15:30    [W:0.020 / U:5.764 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site