Re: timer problem

2011-07-09 Thread Prashant Shah
Hi, On Thu, Jul 7, 2011 at 2:48 PM, Daniel Baluta wrote: > On Wed, Jul 6, 2011 at 11:48 PM, Daniel Baluta > wrote: >> Hello Prashant, >> > is the one pointed below (schedule_timeout called in interrupt context). > Yes indeed ! the call to in_interrupt() returns 256 Thanks. __

Re: timer problem

2011-07-07 Thread Daniel Baluta
On Wed, Jul 6, 2011 at 11:48 PM, Daniel Baluta wrote: > Hello Prashant, > >> struct timer_list tim; >> >> void timfunc(unsigned long data) >> { > [..] >>        schedule_timeout(10 * HZ); > [..] >> } >> >> static int __init init_testmod(void) >> { >>        init_timer(&tim); >>        tim.expires

Re: timer problem

2011-07-07 Thread Mulyadi Santosa
On Thu, Jul 7, 2011 at 13:58, Vishal Thanki wrote: > On Thu, Jul 7, 2011 at 12:19 PM, Mulyadi Santosa > wrote: >> Hi.. >> >> Trying to add another perspective, feel free to take or not  :) >> >> On Wed, Jul 6, 2011 at 23:52, Prashant Shah wrote: >>> >>> void timfunc(unsigned long data) >>> { >>>

Re: timer problem

2011-07-07 Thread Vishal Thanki
On Thu, Jul 7, 2011 at 12:19 PM, Mulyadi Santosa wrote: > Hi.. > > Trying to add another perspective, feel free to take or not  :) > > On Wed, Jul 6, 2011 at 23:52, Prashant Shah wrote: >> >> void timfunc(unsigned long data) >> { >>        printk("hi this is a timer %lu\n", data); >>        set_c

Re: timer problem

2011-07-06 Thread Mulyadi Santosa
Hi.. Trying to add another perspective, feel free to take or not :) On Wed, Jul 6, 2011 at 23:52, Prashant Shah wrote: > > void timfunc(unsigned long data) > { >        printk("hi this is a timer %lu\n", data); >        set_current_state(TASK_INTERRUPTIBLE); >        schedule_timeout(10 * HZ);

Re: timer problem

2011-07-06 Thread Daniel Baluta
Hello Prashant, > struct timer_list tim; > > void timfunc(unsigned long data) > { [..] >        schedule_timeout(10 * HZ); [..] > } > > static int __init init_testmod(void) > { >        init_timer(&tim); >        tim.expires = jiffies + HZ*5; >        tim.data = 1000; >        tim.function = timfu

timer problem

2011-07-06 Thread Prashant Shah
Hi, I am test out a simple schedule_timeout() code. When I insert the module kernel goes in a infinite loop printing this in the log : Jul 6 22:04:35 ubuntupc kernel: [ 5738.281659] Pid: 0, comm: swapper Not tainted 2.6.35-22-generic #33-Ubuntu Jul 6 22:04:35 ubuntupc kernel: [ 5738.281663] Cal