[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with schedule_timeout() and udelay() in kernel module
Hi there everyone,
I have realized that when I use schedule_timeout and
udelay one after another in a kernel module code, the
udelay doesn't seem to execute when its time parameter
is less than 1000( i.e. less than 1ms).
It seems that schedule_timeout uses ms and if delay in
udelay(delay) is less than 1ms, it is treated as zero.
It seems whenever schedule_timeout appears, the
minimal unit is ms.
This is the code segment
......
if(delay < 1000)
udelay(delay);
else
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout (delay/1000);
if(delay >= 1000){
delay2=delay%1000;
udelay(delay2);}
}
.......
For some reason, the udelay here doesn't seem to
execute when we check using the time command
I was wondering if anyone has encountered issued like
this before
Thanks in advance!
I.S.
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/