> Description: Use msleep_interruptible() instead of schedule_timeout() to > guarantee the task delays as expected. Changed tm to an int, as it now is in > terms of msecs, not jiffies. I've applied it to my tree, thank you. Greg please push it upstream. Signed-off-by: Nishanth Aravamudan Signed-off-by: Evgeniy Polyakov Signed-off-by: Domen Puncer --- kj-domen/drivers/w1/w1_therm.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff -puN drivers/w1/w1_therm.c~msleep_interruptible-drivers_w1_w1_therm drivers/w1/w1_therm.c --- kj/drivers/w1/w1_therm.c~msleep_interruptible-drivers_w1_w1_therm 2005-01-23 00:24:22.000000000 +0100 +++ kj-domen/drivers/w1/w1_therm.c 2005-01-23 00:24:22.000000000 +0100 @@ -26,6 +26,7 @@ #include #include #include +#include #include "w1.h" #include "w1_io.h" @@ -128,7 +129,7 @@ static ssize_t w1_therm_read_bin(struct if (!w1_reset_bus (dev)) { int count = 0; u8 match[9] = {W1_MATCH_ROM, }; - unsigned long tm; + unsigned int tm = 750; memcpy(&match[1], (u64 *) & sl->reg_num, 8); @@ -136,11 +137,8 @@ static ssize_t w1_therm_read_bin(struct w1_write_8(dev, W1_CONVERT_TEMP); - tm = jiffies + msecs_to_jiffies(750); - while(time_before(jiffies, tm)) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(tm-jiffies); - + while (tm) { + tm = msleep_interruptible(tm); if (signal_pending(current)) flush_signals(current); } _