patch-2.2.14 linux/drivers/scsi/sd.c

Next file: linux/drivers/scsi/seagate.c
Previous file: linux/drivers/scsi/scsi_ioctl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.13/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
@@ -1239,13 +1239,16 @@
 		    spintime = jiffies;
 		}
 
-		time1 = jiffies + HZ;
 		spin_unlock_irq(&io_request_lock);
-		while(jiffies < time1); /* Wait 1 second for next try */
+		time1 = HZ;
+		do {
+		    current->state = TASK_UNINTERRUPTIBLE;
+		    time1 = schedule_timeout(time1);
+		} while (time1); /* Wait 1 second for next try */
 		printk( "." );
 		spin_lock_irq(&io_request_lock);
 	    }
-	} while(the_result && spintime && spintime+100*HZ > jiffies);
+	} while(the_result && spintime && time_before(jiffies, spintime+100*HZ));
 	if (spintime) {
 	    if (the_result)
 		printk( "not responding...\n" );
@@ -1315,6 +1318,7 @@
 
 	printk("%s : block size assumed to be 512 bytes, disk size 1GB.  \n",
 	       nbuff);
+
 	rscsi_disks[i].capacity = 0x1fffff;
 	rscsi_disks[i].sector_size = 512;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)