From 8d7ec6ee59e78140bf01c7d0d009ea39ab6b3b59 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 20 May 2010 10:56:29 +0200 Subject: microblaze: Fix __copy_to/from_user_inatomic macros __copy_to/from_user_inatomic should call __copy_to/from_user because there is not necessary to check access because of kernel function. might_sleep in copy_to/from_user macros is causing problems in debug sessions too (CONFIG_DEBUG_SPINLOCK_SLEEP). BUG: sleeping function called from invalid context at .../arch/microblaze/include/asm/uaccess.h:388 in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper 1 lock held by swapper/1: #0: (&p->cred_guard_mutex){......}, at: [] prepare_bprm_creds+0x2c/0x88 Kernel Stack: ... Call Trace: [] microblaze_unwind+0x7c/0x94 [] show_stack+0xf4/0x190 [] dump_stack+0x10/0x30 [] __might_sleep+0x12c/0x160 [] file_read_actor+0x1d8/0x2a8 [] generic_file_aio_read+0x6b4/0xa64 [] do_sync_read+0xac/0x110 [] vfs_read+0xc8/0x160 [] kernel_read+0x38/0x64 [] prepare_binprm+0xfc/0x130 [] do_execve+0x228/0x370 [] microblaze_execve+0x58/0xa4 caused by file_read_actor (mm/filemap.c) which calls __copy_to_user_inatomic. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index 26460d15b338..d840f4a2d3c9 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h @@ -359,7 +359,7 @@ extern long __user_bad(void); __copy_tofrom_user((__force void __user *)(to), \ (void __user *)(from), (n)) #define __copy_from_user_inatomic(to, from, n) \ - copy_from_user((to), (from), (n)) + __copy_from_user((to), (from), (n)) static inline long copy_from_user(void *to, const void __user *from, unsigned long n) @@ -373,7 +373,7 @@ static inline long copy_from_user(void *to, #define __copy_to_user(to, from, n) \ __copy_tofrom_user((void __user *)(to), \ (__force const void __user *)(from), (n)) -#define __copy_to_user_inatomic(to, from, n) copy_to_user((to), (from), (n)) +#define __copy_to_user_inatomic(to, from, n) __copy_to_user((to), (from), (n)) static inline long copy_to_user(void __user *to, const void *from, unsigned long n) -- cgit v1.2.3