Commit 2ddb7e4f authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Greg Kroah-Hartman

[PATCH] I2C: replace schedule_timeout() with msleep_interruptible() in i2c-ibm_iic.c

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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 663a6746
...@@ -416,10 +416,8 @@ static int iic_wait_for_tc(struct ibm_iic_private* dev){ ...@@ -416,10 +416,8 @@ static int iic_wait_for_tc(struct ibm_iic_private* dev){
init_waitqueue_entry(&wait, current); init_waitqueue_entry(&wait, current);
add_wait_queue(&dev->wq, &wait); add_wait_queue(&dev->wq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
if (in_8(&iic->sts) & STS_PT) if (in_8(&iic->sts) & STS_PT)
schedule_timeout(dev->adap.timeout * HZ); msleep_interruptible(dev->adap.timeout * 1000);
set_current_state(TASK_RUNNING);
remove_wait_queue(&dev->wq, &wait); remove_wait_queue(&dev->wq, &wait);
if (unlikely(signal_pending(current))){ if (unlikely(signal_pending(current))){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment