patch-2.4.14 linux/drivers/scsi/qlogicfc.c

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

diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/qlogicfc.c linux/drivers/scsi/qlogicfc.c
@@ -803,9 +803,10 @@
 			outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR);
 			isp2x00_enable_irqs(host);
 			/* wait for the loop to come up */
-			for (wait_time = jiffies + 10 * HZ; wait_time > jiffies && hostdata->adapter_state == AS_LOOP_DOWN;)
+			for (wait_time = jiffies + 10 * HZ; wait_time > jiffies && hostdata->adapter_state == AS_LOOP_DOWN;) {
 			        barrier();
-
+				cpu_relax();
+			}
 			if (hostdata->adapter_state == AS_LOOP_DOWN) {
 			        printk("qlogicfc%d : link is not up\n", hostdata->host_id);
 			}
@@ -819,8 +820,10 @@
 	   some time before recognizing it is attached to a fabric */
 
 #if ISP2x00_FABRIC
-	for (wait_time = jiffies + 5 * HZ; wait_time > jiffies;)
+	for (wait_time = jiffies + 5 * HZ; wait_time > jiffies;) {
 		barrier();
+		cpu_relax();
+	}
 #endif
 
 	LEAVE("isp2x00_detect");
@@ -1840,8 +1843,10 @@
 	outw(HCCR_BIOS_DISABLE, host->io_port + HOST_HCCR);
 
 	loop_count = DEFAULT_LOOP_COUNT;
-	while (--loop_count && inw(host->io_port + HOST_HCCR) == RISC_BUSY)
+	while (--loop_count && inw(host->io_port + HOST_HCCR) == RISC_BUSY) {
 		barrier();
+		cpu_relax();
+	}
 	if (!loop_count)
 		printk("qlogicfc%d : reset_hardware loop timeout\n", hostdata->host_id);
 
@@ -2118,8 +2123,10 @@
 		return 1;
 
 	loop_count = DEFAULT_LOOP_COUNT;
-	while (--loop_count && inw(host->io_port + HOST_HCCR) & 0x0080)
+	while (--loop_count && inw(host->io_port + HOST_HCCR) & 0x0080) {
 		barrier();
+		cpu_relax();
+	}
 	if (!loop_count) {
 		printk("qlogicfc%d : mbox_command loop timeout #1\n", hostdata->host_id);
 		param[0] = 0x4006;
@@ -2153,8 +2160,9 @@
 
 	while (1) {
 		loop_count = DEFAULT_LOOP_COUNT;
-		while (--loop_count && !(inw(host->io_port + PCI_INTER_STS) & 0x08)) {
+		while (--loop_count && !(inw(host->io_port + PCI_INTER_STS) & 0x08)) { 
 			barrier();
+			cpu_relax();
 		}
 
 		if (!loop_count) {
@@ -2172,6 +2180,7 @@
 	loop_count = DEFAULT_LOOP_COUNT;
 	while (--loop_count && inw(host->io_port + MBOX0) == 0x04) {
 		barrier();
+		cpu_relax();
 	}
 	if (!loop_count)
 		printk("qlogicfc%d : mbox_command loop timeout #3\n", hostdata->host_id);

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