]>
Commit | Line | Data |
---|---|---|
e3010154 GKH |
1 | From 4bea3418c737891894b9d3d3e9f8bbd67d66fa38 Mon Sep 17 00:00:00 2001 |
2 | From: Matt Fleming <matt@console-pimps.org> | |
3 | Date: Sun, 28 Mar 2010 20:08:25 +0000 | |
4 | Subject: sh: Enable the mmu in start_secondary() | |
5 | ||
6 | From: Matt Fleming <matt@console-pimps.org> | |
7 | ||
8 | commit 4bea3418c737891894b9d3d3e9f8bbd67d66fa38 upstream. | |
9 | ||
10 | For the boot, enable_mmu() is called from setup_arch() but we don't call | |
11 | setup_arch() for any of the other cpus. So turn on the non-boot cpu's | |
12 | mmu inside of start_secondary(). | |
13 | ||
14 | I noticed this bug on an SMP board when trying to map I/O memory | |
15 | (smsc911x registers) into the kernel address space. Since the Address | |
16 | Translation bit in MMUCR wasn't set, accessing the virtual address where | |
17 | the smsc911x registers were supposedly mapped actually performed a | |
18 | physical address access. | |
19 | ||
20 | Signed-off-by: Matt Fleming <matt@console-pimps.org> | |
21 | Signed-off-by: Paul Mundt <lethal@linux-sh.org> | |
22 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
23 | ||
24 | --- a/arch/sh/kernel/smp.c | |
25 | +++ b/arch/sh/kernel/smp.c | |
26 | @@ -69,6 +69,7 @@ asmlinkage void __cpuinit start_secondary(void) | |
27 | unsigned int cpu; | |
28 | struct mm_struct *mm = &init_mm; | |
29 | ||
30 | + enable_mmu(); | |
31 | atomic_inc(&mm->mm_count); | |
32 | atomic_inc(&mm->mm_users); | |
33 | current->active_mm = mm; |