Any comments would be appreciated. Description: msleep_interruptible() is used instead of schedule_timeout() to guarantee the task delays as expected. To achieve this, the timeout variable is converted from jiffies to msecs. Also, set_current_state() is used instead of direct assignment. Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/base/dmapool.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff -puN drivers/base/dmapool.c~msleep_interruptible-drivers_base_dmapool drivers/base/dmapool.c --- kj/drivers/base/dmapool.c~msleep_interruptible-drivers_base_dmapool 2004-12-25 01:34:39.000000000 +0100 +++ kj-domen/drivers/base/dmapool.c 2004-12-25 01:34:39.000000000 +0100 @@ -7,6 +7,7 @@ #include #include #include +#include /* * Pool allocator ... wraps the dma_alloc_coherent page allocator, so @@ -34,7 +35,7 @@ struct dma_page { /* cacheable header fo unsigned long bitmap [0]; }; -#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000) +#define POOL_TIMEOUT_MSECS (100) /* msec */ #define POOL_POISON_FREED 0xa7 /* !inuse */ #define POOL_POISON_ALLOCATED 0xa9 /* !initted */ @@ -293,11 +294,11 @@ restart: if (mem_flags & __GFP_WAIT) { DECLARE_WAITQUEUE (wait, current); - current->state = TASK_INTERRUPTIBLE; + set_current_state (TASK_INTERRUPTIBLE); add_wait_queue (&pool->waitq, &wait); spin_unlock_irqrestore (&pool->lock, flags); - schedule_timeout (POOL_TIMEOUT_JIFFIES); + msleep_interruptible(POOL_TIMEOUT_MSECS); remove_wait_queue (&pool->waitq, &wait); goto restart; _