diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2013-02-12 09:44:50 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-02-15 00:55:06 -0500 |
commit | 25e138149c19fa0680147b825be475f5fd57f155 (patch) | |
tree | 4061bd5e4d9cf8c0aea5cb026d59423747b7896d /arch/powerpc/kernel/setup_64.c | |
parent | 6a7e406419d8b176efbc5be41a82299025ad1b43 (diff) |
powerpc: Apply early paca fixups to boot_paca and the boot cpu's paca
In commit 466921c we added a hack to set the paca data_offset to zero so
that per-cpu accesses would work on the boot cpu prior to per-cpu areas
being setup. This fixed a problem with lockdep touching per-cpu areas
very early in boot.
However if we combine CONFIG_LOCK_STAT=y with any of the PPC_EARLY_DEBUG
options, we can hit the same problem in udbg_early_init(). To avoid that
we need to set the data_offset of the boot_paca also. So factor out the
fixup logic and call it for both the boot_paca, and "the paca of the
boot cpu".
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Tested-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f2514e13062b..75fbaceb5c87 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -156,6 +156,15 @@ early_param("smt-enabled", early_smt_enabled); | |||
156 | #define check_smt_enabled() | 156 | #define check_smt_enabled() |
157 | #endif /* CONFIG_SMP */ | 157 | #endif /* CONFIG_SMP */ |
158 | 158 | ||
159 | /** Fix up paca fields required for the boot cpu */ | ||
160 | static void fixup_boot_paca(void) | ||
161 | { | ||
162 | /* The boot cpu is started */ | ||
163 | get_paca()->cpu_start = 1; | ||
164 | /* Allow percpu accesses to work until we setup percpu data */ | ||
165 | get_paca()->data_offset = 0; | ||
166 | } | ||
167 | |||
159 | /* | 168 | /* |
160 | * Early initialization entry point. This is called by head.S | 169 | * Early initialization entry point. This is called by head.S |
161 | * with MMU translation disabled. We rely on the "feature" of | 170 | * with MMU translation disabled. We rely on the "feature" of |
@@ -187,6 +196,7 @@ void __init early_setup(unsigned long dt_ptr) | |||
187 | /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ | 196 | /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ |
188 | initialise_paca(&boot_paca, 0); | 197 | initialise_paca(&boot_paca, 0); |
189 | setup_paca(&boot_paca); | 198 | setup_paca(&boot_paca); |
199 | fixup_boot_paca(); | ||
190 | 200 | ||
191 | /* Initialize lockdep early or else spinlocks will blow */ | 201 | /* Initialize lockdep early or else spinlocks will blow */ |
192 | lockdep_init(); | 202 | lockdep_init(); |
@@ -207,11 +217,7 @@ void __init early_setup(unsigned long dt_ptr) | |||
207 | 217 | ||
208 | /* Now we know the logical id of our boot cpu, setup the paca. */ | 218 | /* Now we know the logical id of our boot cpu, setup the paca. */ |
209 | setup_paca(&paca[boot_cpuid]); | 219 | setup_paca(&paca[boot_cpuid]); |
210 | 220 | fixup_boot_paca(); | |
211 | /* Fix up paca fields required for the boot cpu */ | ||
212 | get_paca()->cpu_start = 1; | ||
213 | /* Allow percpu accesses to "work" until we setup percpu data */ | ||
214 | get_paca()->data_offset = 0; | ||
215 | 221 | ||
216 | /* Probe the machine type */ | 222 | /* Probe the machine type */ |
217 | probe_machine(); | 223 | probe_machine(); |