Skip to contentSkip to conversation

scsi/osst: replace schedule_timeout() with msleep_interruptible()

PATCH New [email protected] 1 participant 1 message Oct 21, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 4/10 scsi/osst: replace schedule_timeout() with msleep_interruptible()

Any comments would be appreciated.

Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.

---

 linux-2.6.9-max/drivers/scsi/osst.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/osst.c renamed from drivers/scsi/osst.c~msleep-drivers_scsi_osst +2 -3
diff -puN drivers/scsi/osst.c~msleep-drivers_scsi_osst drivers/scsi/osst.c
@@ -1488,8 +1488,7 @@ static int osst_reposition_and_retry(OS_
 			osst_set_frame_position(STp, aSRpnt, frame + skip, 1);
 			flag = 0;
 			attempts--;
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(HZ / 10);
+			msleep_interruptible(100);
 		}
 		if (osst_get_frame_position(STp, aSRpnt) < 0) {		/* additional write error */
 #if DEBUG
@@ -1550,7 +1549,7 @@ static int osst_reposition_and_retry(OS_
 			debugging = 0;
 		}
 #endif
-		schedule_timeout(HZ / 10);
+		msleep_interruptible(100);
 	}
 	printk(KERN_ERR "%s:E: Failed to find valid tape media\n", name);
 #if DEBUG

_