Skip to contentSkip to conversation

SD: infinite loop. (resend)

PATCH Rogier Wolff 1 participant 1 message Jan 31, 2001 SCSI

lore
Share & tools
lore
#0 lore raw

Hi Linus,

You must have missed this the first time. So I'll send it again.

There is a small problem in sd.c: If a disk doesn't become ready, the loop to try and spin it up doesn't terminate. This can be fixed by moving one statement up a few lines. Patch below

(the "start of the loop time" variable (spintime_value) is set INSIDE the loop, which means that the timeout is 100 seconds from 'now' and stays that way. By moving it up into the "if" above, the value is only set on the first iteration around the loop. )

Roger.

drivers/scsi/sd.c +1 -1
@@ -798,9 +798,9 @@
 				SRpnt->sr_data_direction = SCSI_DATA_READ;
 				scsi_wait_req(SRpnt, (void *) cmd, (void *) buffer,
 					    0/*512*/, SD_TIMEOUT, MAX_RETRIES);
+				spintime_value = jiffies;
 			}
 			spintime = 1;
-			spintime_value = jiffies;
 			time1 = HZ;
 			/* Wait 1 second for next try */
 			do {
Signature · 8 lines
** [email protected] ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/