Messages in this thread Patch in this message | | | Subject | Re: [PATCH] I2C update for 2.6.9 | Date | Tue, 19 Oct 2004 17:18:26 -0700 | From | Greg KH <> |
| |
ChangeSet 1.2072, 2004/10/19 15:21:15-07:00, nacc@us.ibm.com
[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: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/i2c/busses/i2c-ibm_iic.c | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-)
diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c --- a/drivers/i2c/busses/i2c-ibm_iic.c 2004-10-19 16:53:58 -07:00 +++ b/drivers/i2c/busses/i2c-ibm_iic.c 2004-10-19 16:53:58 -07:00 @@ -416,10 +416,8 @@ 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))){ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |