Skip to contentSkip to conversation

Add Domain Validation to 53c700 driver

PATCH New James Bottomley 1 participant 1 message Mar 14, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add Domain Validation to 53c700 driver

This simply throws out the 53c700 driver's optimistic setting of the best possible transport parameters and replaces it with DV determination. It also adds a missing report_bus_reset() callback and finally does a delayed DV on device errors.

James

===== drivers/scsi/53c700.c 1.48 vs edited =====

drivers/scsi/53c700.c +10 -3
@@ -1522,6 +1522,8 @@
 			printk(KERN_ERR "scsi%d: Bus Reset detected, executing command %p, slot %p, dsp %08x[%04x]\n",
 			       host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript);
 
+			scsi_report_bus_reset(host, 0);
+
 			/* clear all the negotiated parameters */
 			__shost_for_each_device(SDp, host)
 				SDp->hostdata = 0;
@@ -1967,6 +1969,9 @@
 	wait_for_completion(&complete);
 	spin_lock_irq(SCp->device->host->host_lock);
 	hostdata->eh_complete = NULL;
+	/* Revalidate the transport parameters of the failing device */
+	if(hostdata->fast)
+		spi_schedule_dv_device(SCp->device);
 	return SUCCESS;
 }
 
@@ -2051,9 +2056,11 @@
 		scsi_adjust_queue_depth(SDp, 0, SDp->host->cmd_per_lun);
 	}
 	if(hostdata->fast) {
-		NCR_700_set_period(SDp, hostdata->min_period);
-		NCR_700_set_offset(SDp, hostdata->chip710
-				   ? NCR_710_MAX_OFFSET : NCR_700_MAX_OFFSET);
+		/* Find the correct offset and period via domain validation */
+		spi_dv_device(SDp);
+	} else {
+		spi_offset(SDp) = 0;
+		spi_period(SDp) = 0;
 	}
 	return 0;
 }