wifi_drv: call schedule() in sleep functions

The jiffies are only updated on each round of scheduling the runnable
tasks. We have to schedule the current task that executes the sleep
call to update the jiffies count and thereby preventing the task from
entering an endless loop when using a statement like
'while (!time_after(jiffies, now + timeout)) { msleep(1); }'.

Related to #1326.
This commit is contained in:
Josef Söntgen 2014-12-16 13:35:53 +01:00 committed by Christian Helmuth
parent 9ed935ff2a
commit 4c7a5bb388
1 changed files with 24 additions and 3 deletions

View File

@ -1048,9 +1048,30 @@ int strict_strtoul(const char *s, unsigned int base, unsigned long *res)
static Timer::Connection _timer;
void udelay(unsigned long usecs) { _timer.usleep(usecs); }
void usleep_range(unsigned long min, unsigned long max) { _timer.usleep(min); }
void msleep(unsigned int msecs) { _timer.msleep(msecs); }
void udelay(unsigned long usecs)
{
_timer.usleep(usecs);
Lx::scheduler().current()->schedule();
}
void usleep_range(unsigned long min, unsigned long max)
{
_timer.usleep(min);
Lx::scheduler().current()->schedule();
}
void msleep(unsigned int msecs)
{
_timer.msleep(msecs);
Lx::scheduler().current()->schedule();
}
void mdelay(unsigned long msecs) { msleep(msecs); }