patch-1.3.35 linux/drivers/scsi/eata_dma_proc.c

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

diff -u --recursive --new-file v1.3.34/linux/drivers/scsi/eata_dma_proc.c linux/drivers/scsi/eata_dma_proc.c
@@ -181,28 +181,16 @@
 	scmd.channel = 0;
 	scmd.use_sg = 0;
 
-	/* Used for mutex if loading devices after boot */
-	scmd.request.sem = NULL;
-	scmd.request.rq_status = RQ_SCSI_BUSY;
-	
-	scsi_do_cmd (&scmd, cmnd, buff + 0x144, 0x66,  
-		     eata_scsi_done, 1 * HZ, 1);
 	/*
-	 * Wait for command to finish. Use simple wait if we are
-	 * booting, else do it right and use a mutex
+	 * Do the command and wait for it to finish.
 	 */	
-	if (current->pid == 0) {
-	    while (scmd.request.rq_status != RQ_SCSI_DONE)
-		barrier();
-	} else if (scmd.request.rq_status != RQ_SCSI_DONE) {
+	{
 	    struct semaphore sem = MUTEX_LOCKED;
-	    
+	    scmd.request.rq_status = RQ_SCSI_BUSY;
 	    scmd.request.sem = &sem;
+	    scsi_do_cmd (&scmd, cmnd, buff + 0x144, 0x66,  
+			 eata_scsi_done, 1 * HZ, 1);
 	    down(&sem);
-	    
-	    /* Hmm.. Have to ask about this one */
-	    while (scmd.request.rq_status != RQ_SCSI_DONE)
-	      schedule();
 	}
 
 	size = sprintf(buffer + len, "IRQ: %2d, %s triggered\n", cc->interrupt,
@@ -321,30 +309,18 @@
  
 	scmd.cmd_len = 10;
 
-	/* Used for mutex if loading devices after boot */
-	scmd.request.sem = NULL;
-	scmd.request.rq_status = RQ_SCSI_BUSY; /* Mark busy */
-	
-	scsi_do_cmd (&scmd, cmnd, buff2, 0x144,  
-		     eata_scsi_done, 1 * HZ, 1);
 	/*
-	 * Wait for command to finish. Use simple wait if we are
-	 * booting, else do it right and use a mutex
+	 * Do the command and wait for it to finish.
 	 */	
-	if (current->pid == 0)
-	    while (scmd.request.rq_status != RQ_SCSI_DONE)
-		barrier();
-	else if (scmd.request.rq_status != RQ_SCSI_DONE) {
+	{
 	    struct semaphore sem = MUTEX_LOCKED;
-	    
+	    scmd.request.rq_status = RQ_SCSI_BUSY;
 	    scmd.request.sem = &sem;
+	    scsi_do_cmd (&scmd, cmnd, buff2, 0x144,
+			 eata_scsi_done, 1 * HZ, 1);
 	    down(&sem);
-	    
-	    /* Hmm.. Have to ask about this one */
-	    while (scmd.request.rq_status != RQ_SCSI_DONE)
-	      schedule();
 	}
-	
+
 	swap_statistics(buff2);
 	rhcs = (hst_cmd_stat *)(buff2 + 0x2c); 
 	whcs = (hst_cmd_stat *)(buff2 + 0x8c);		 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this