Hi
I am Using Kernel timers to send signal to a user process but during the process i am getting below mentioned message in log( through dmesg)
I am using timer_list structure to create a timer on kernel module & sending requests from user by ioctl.

BUG: sleeping function called from invalid context at mm/slab.c:3007
in_atomic():1, irqs_disabled():0
[<c0103a43>] dump_trace+0x69/0x1b6
[<c0103ba8>] show_trace_log_lvl+0x18/0x2c
[<c0104158>] show_trace+0xf/0x11
[<c01041e2>] dump_stack+0x15/0x17
[<c015ac46>] kmem_cache_alloc+0x1b/0x4f
[<d01fa26e>] generate_signal+0x12/0x94 [sighnd]
[<c012291a>] run_timer_softirq+0xef/0x14f
[<c011f9a7>] __do_softirq+0x35/0x75
[<c0104be2>] do_softirq+0x3e/0x8d
=======================
Code:
#define TIMER_REFRESH_SUBSCRIBED_TABLE 50
struct timer_list cTimer;
static void generate_signal(void) {
struct task_struct *p=NULL;
p=kmalloc(sizeof(struct task_struct), GFP_KERNEL);
p = find_task_by_pid(pid);
if (p == NULL) {
printk("Unable to find task for process id %d\n",pid);
return;
}
if ( send_sig(50,p,0) != 0 )
printk("Sending signal failed . . .\n");
cTimer.function = (void*)&generate_signal;
cTimer.expires = jiffies + TIMER_REFRESH_SUBSCRIBED_TABLE;
add_timer (&cTimer);
return;
}
---------------
static int watchdog_init (void) {
cTimer.function = (void*)generate_signal;
cTimer.expires = TIMER_REFRESH_SUBSCRIBED_TABLE;
add_timer (&cTimer);
return 0;
}
---------------
The function call is like:
init_module()
{ init_timer (&cTimer);
...
}
---------------
Inside ioctl handler the function watchdog_init() is called .
Please help me in this regard because i am totaly new in kernel modules
Regards
GP