Hi All, I am getting an error "Scheduling while atomic" very infrequently on Linux 2.6.14 kernel on MIPS architecture with this piece of my kernel module (Mymodule.ko) . My kernel module codes look like : //This function is called from the process context fn_in_process_context () { //some code here in_use = 1; wait_event (queue, in_use==0); //some more code } //This function is called from the interrupt context.....in bottom half callback_fn_in_interrupt_context() { //some code here in_use = 0; wake_up (queue); //some more code } The commented out code is just lots of assignment to local variable etc. and the call stack looks like : scheduling while atomic: mymodule/0xffffff00/564 Call Trace: [<803fc3c0>] schedule+0x74/0x980 [<8011cbec>] __wake_up+0x34/0x64 [<803fc34c>] schedule+0x0/0x980 [<80138548>] prepare_to_wait+0x0/0x7c [<c00553b0>] fn_in_process_context+0x32c/0x578 [mymodule] [<80126510>] irq_exit+0x40/0x4c [<80126348>] __do_softirq+0x68/0xec [<801386a8>] autoremove_wake_function+0x0/0x44 [<802be1e4>] __copy_user+0x0/0x1c [<801386a8>] autoremove_wake_function+0x0/0x44 [<801386a8>] autoremove_wake_function+0x0/0x44 Does wake_up() function somehow calls the schedule() ? Is it safe to call wake_up from interrupt context? Or there is something else that is responsible for this error ? -- Best regards, Ranjan -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/