Use msleep_interruptible() instead of schedule_timeout() to
guarantee the task delays as expected. Remove the unnecessary
set_current_state() following the if, as schedule_timeout() [and thus,
mlseep_interruptible()] is guaranteed to return in TASK_RUNNING.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
init_waitqueue_entry(&wait, current);
add_wait_queue(&dev->wq, &wait);
- set_current_state(TASK_INTERRUPTIBLE);
if (in_8(&iic->sts) & STS_PT)
- schedule_timeout(dev->adap.timeout * HZ);
- set_current_state(TASK_RUNNING);
+ msleep_interruptible(dev->adap.timeout * 1000);
remove_wait_queue(&dev->wq, &wait);
if (unlikely(signal_pending(current))){