]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.12/sh-enable-the-mmu-in-start_secondary.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / sh-enable-the-mmu-in-start_secondary.patch
CommitLineData
e3010154
GKH
1From 4bea3418c737891894b9d3d3e9f8bbd67d66fa38 Mon Sep 17 00:00:00 2001
2From: Matt Fleming <matt@console-pimps.org>
3Date: Sun, 28 Mar 2010 20:08:25 +0000
4Subject: sh: Enable the mmu in start_secondary()
5
6From: Matt Fleming <matt@console-pimps.org>
7
8commit 4bea3418c737891894b9d3d3e9f8bbd67d66fa38 upstream.
9
10For the boot, enable_mmu() is called from setup_arch() but we don't call
11setup_arch() for any of the other cpus. So turn on the non-boot cpu's
12mmu inside of start_secondary().
13
14I 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
16Translation bit in MMUCR wasn't set, accessing the virtual address where
17the smsc911x registers were supposedly mapped actually performed a
18physical address access.
19
20Signed-off-by: Matt Fleming <matt@console-pimps.org>
21Signed-off-by: Paul Mundt <lethal@linux-sh.org>
22Signed-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;