diff options
-rw-r--r-- | arch/powerpc/lib/code-patching.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index c9de03e0c1f1..d469224c4ada 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/tlbflush.h> | 21 | #include <asm/tlbflush.h> |
22 | #include <asm/page.h> | 22 | #include <asm/page.h> |
23 | #include <asm/code-patching.h> | 23 | #include <asm/code-patching.h> |
24 | #include <asm/setup.h> | ||
24 | 25 | ||
25 | static int __patch_instruction(unsigned int *addr, unsigned int instr) | 26 | static int __patch_instruction(unsigned int *addr, unsigned int instr) |
26 | { | 27 | { |
@@ -146,11 +147,8 @@ int patch_instruction(unsigned int *addr, unsigned int instr) | |||
146 | * During early early boot patch_instruction is called | 147 | * During early early boot patch_instruction is called |
147 | * when text_poke_area is not ready, but we still need | 148 | * when text_poke_area is not ready, but we still need |
148 | * to allow patching. We just do the plain old patching | 149 | * to allow patching. We just do the plain old patching |
149 | * We use slab_is_available and per cpu read * via this_cpu_read | ||
150 | * of text_poke_area. Per-CPU areas might not be up early | ||
151 | * this can create problems with just using this_cpu_read() | ||
152 | */ | 150 | */ |
153 | if (!slab_is_available() || !this_cpu_read(text_poke_area)) | 151 | if (!this_cpu_read(*PTRRELOC(&text_poke_area))) |
154 | return __patch_instruction(addr, instr); | 152 | return __patch_instruction(addr, instr); |
155 | 153 | ||
156 | local_irq_save(flags); | 154 | local_irq_save(flags); |