* [PATCH] sh: Enable the mmu in start_secondary()
@ 2010-03-28 20:08 Matt Fleming
2010-03-29 3:16 ` Paul Mundt
0 siblings, 1 reply; 2+ messages in thread
From: Matt Fleming @ 2010-03-28 20:08 UTC (permalink / raw)
To: linux-sh
For the boot, enable_mmu() is called from setup_arch() but we don't call
setup_arch() for any of the other cpus. So turn on the non-boot cpu's
mmu inside of start_secondary().
I noticed this bug on an SMP board when trying to map I/O memory
(smsc911x registers) into the kernel address space. Since the Address
Translation bit in MMUCR wasn't set, accessing the virtual address where
the smsc911x registers were supposedly mapped actually performed a
physical address access.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
---
arch/sh/kernel/smp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index e124cf7..002cc61 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -69,6 +69,7 @@ asmlinkage void __cpuinit start_secondary(void)
unsigned int cpu;
struct mm_struct *mm = &init_mm;
+ enable_mmu();
atomic_inc(&mm->mm_count);
atomic_inc(&mm->mm_users);
current->active_mm = mm;
--
1.6.4.rc0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sh: Enable the mmu in start_secondary()
2010-03-28 20:08 [PATCH] sh: Enable the mmu in start_secondary() Matt Fleming
@ 2010-03-29 3:16 ` Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2010-03-29 3:16 UTC (permalink / raw)
To: linux-sh
On Sun, Mar 28, 2010 at 09:08:25PM +0100, Matt Fleming wrote:
> For the boot, enable_mmu() is called from setup_arch() but we don't call
> setup_arch() for any of the other cpus. So turn on the non-boot cpu's
> mmu inside of start_secondary().
>
> I noticed this bug on an SMP board when trying to map I/O memory
> (smsc911x registers) into the kernel address space. Since the Address
> Translation bit in MMUCR wasn't set, accessing the virtual address where
> the smsc911x registers were supposedly mapped actually performed a
> physical address access.
>
> Signed-off-by: Matt Fleming <matt@console-pimps.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-29 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-28 20:08 [PATCH] sh: Enable the mmu in start_secondary() Matt Fleming
2010-03-29 3:16 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).