Skip to content

Commit

Permalink
[MIPS] Make SB1 cache flushes not to use on_each_cpu
Browse files Browse the repository at this point in the history
This fixes the

  start_kernel(): bug: interrupts were enabled early

messages.

Signed-off-by: Manish Lachwani <mlachwani@mvista.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Manish Lachwani authored and Ralf Baechle committed Oct 30, 2006
1 parent f0ec69e commit 9448b8f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions arch/mips/mm/c-sb1.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ static unsigned short dcache_sets;
static unsigned int icache_range_cutoff;
static unsigned int dcache_range_cutoff;

static inline void sb1_on_each_cpu(void (*func) (void *info), void *info,
int retry, int wait)
{
preempt_disable();
smp_call_function(func, info, retry, wait);
func(info);
preempt_enable();
}

/*
* The dcache is fully coherent to the system, with one
* big caveat: the instruction stream. In other words,
Expand Down Expand Up @@ -226,7 +235,7 @@ static void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr,
args.vma = vma;
args.addr = addr;
args.pfn = pfn;
on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1);
sb1_on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1);
}
#else
void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
Expand All @@ -249,7 +258,7 @@ void sb1___flush_cache_all_ipi(void *ignored)

static void sb1___flush_cache_all(void)
{
on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1);
sb1_on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1);
}
#else
void sb1___flush_cache_all(void)
Expand Down Expand Up @@ -299,7 +308,7 @@ void sb1_flush_icache_range(unsigned long start, unsigned long end)

args.start = start;
args.end = end;
on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1);
sb1_on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1);
}
#else
void sb1_flush_icache_range(unsigned long start, unsigned long end)
Expand All @@ -326,7 +335,7 @@ static void sb1_flush_cache_sigtramp_ipi(void *info)

static void sb1_flush_cache_sigtramp(unsigned long addr)
{
on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
sb1_on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
}
#else
void sb1_flush_cache_sigtramp(unsigned long addr)
Expand Down

0 comments on commit 9448b8f

Please sign in to comment.