patch-2.1.120 linux/drivers/scsi/NCR5380.c

Next file: linux/drivers/scsi/README.in2000
Previous file: linux/drivers/pnp/parport_probe.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.119/linux/drivers/scsi/NCR5380.c linux/drivers/scsi/NCR5380.c
@@ -32,6 +32,12 @@
 /*
  * $Log: NCR5380.c,v $
 
+ * Revision 1.10 1998/9/2	Alan Cox
+ *				(alan@redhat.com)
+ * Fixed up the timer lockups reported so far. Things still suck. Looking 
+ * forward to 2.3 and per device request queues. Then it'll be possible to
+ * SMP thread this beast and improve life no end.
+ 
  * Revision 1.9  1997/7/27	Ronald van Cuijlenborg
  *				(ronald.van.cuijlenborg@tip.nl or nutty@dds.nl)
  * (hopefully) fixed and enhanced USLEEP
@@ -1524,8 +1530,11 @@
 							{
 								unsigned long timeout = jiffies + NCR_TIMEOUT;
 
+								spin_unlock_irq(&io_request_lock);
 								while (NCR5380_read(BUS_AND_STATUS_REG) & BASR_ACK
 								       && jiffies < timeout);
+								spin_lock_irq(&io_request_lock);
+								
 								if (jiffies >= timeout)
 									printk("scsi%d: timeout at NCR5380.c:%d\n",
 									       host->host_no, __LINE__);
@@ -1665,8 +1674,13 @@
 	{
 		unsigned long timeout = jiffies + 2 * NCR_TIMEOUT;
 
+		spin_unlock_irq(&io_request_lock);
+
 		while (!(NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_PROGRESS)
 		       && jiffies < timeout);
+
+		spin_lock_irq(&io_request_lock);
+		       
 		if (jiffies >= timeout) {
 			printk("scsi: arbitration timeout at %d\n", __LINE__);
 			NCR5380_write(MODE_REG, MR_BASE);
@@ -1825,8 +1839,10 @@
 	hostdata->selecting = 0; /* clear this pointer, because we passed the
 				waiting period */
 #else
+	spin_unlock_irq(&io_request_lock);
 	while ((jiffies < timeout) && !(NCR5380_read(STATUS_REG) &
 					(SR_BSY | SR_IO)));
+	spin_lock_irq(&io_request_lock);
 #endif
 	if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) ==
 	    (SR_SEL | SR_IO)) {
@@ -1894,8 +1910,10 @@
 	{
 		unsigned long timeout = jiffies + NCR_TIMEOUT;
 
+		spin_unlock_irq(&io_request_lock);
 		while (!(NCR5380_read(STATUS_REG) & SR_REQ) && jiffies < timeout);
-
+		spin_lock_irq(&io_request_lock);
+		
 		if (jiffies >= timeout) {
 			printk("scsi%d: timeout at NCR5380.c:%d\n", __LINE__);
 			NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov