aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-04 11:08:28 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-05 02:05:23 -0400
commit636802ef96eebe279b22ad9f9dacfe29291e45c7 (patch)
treeaedbdd51b2558d9badd12cb68e5ecc4ed5823474 /arch
parent9fb1b36ca1234e64a5d1cc573175303395e3354d (diff)
powerpc: Don't use __put_user() in patch_instruction
patch_instruction() can be called very early on ppc32, when the kernel isn't yet running at it's linked address. That can cause the ! is_kernel_addr() test in __put_user() to trip and call might_sleep() which is very bad at that point during boot. Use a lower level function instead for now, at least until we get to rework ppc32 boot process to do the code patching later, like ppc64 does. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/lib/code-patching.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c
index dd223b3eb333..17e5b2364312 100644
--- a/arch/powerpc/lib/code-patching.c
+++ b/arch/powerpc/lib/code-patching.c
@@ -20,7 +20,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr)
20{ 20{
21 int err; 21 int err;
22 22
23 err = __put_user(instr, addr); 23 __put_user_size(instr, addr, 4, err);
24 if (err) 24 if (err)
25 return err; 25 return err;
26 asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); 26 asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr));