summary refs log tree commit diff
path: root/drivers/scsi/scsi_transport_spi.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 10:51:23 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 10:51:23 -0500
commit60eef25701d25e99c991dd0f4a9f3832a0c3ad3e (patch)
tree6aedae05234660d5e188328c6165a760fbde4727 /drivers/scsi/scsi_transport_spi.c
parentb2d8bfe18578c4e50e8ba52011c9b260a1b51dac (diff)
downloadlinux-60eef25701d25e99c991dd0f4a9f3832a0c3ad3e.tar.gz
[SCSI] spi transport: don't allow dt to be set on SE or HVD buses
This is really just a belt and braces test.  The standards require
disks to respond DT not capable on a non-LVD bus ... however, not all
disks follow the standards ...

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r--drivers/scsi/scsi_transport_spi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 5829f97a2068..ace49d5bd9c4 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -785,6 +785,7 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
 {
 	struct spi_internal *i = to_spi_internal(sdev->host->transportt);
 	struct scsi_target *starget = sdev->sdev_target;
+	struct Scsi_Host *shost = sdev->host;
 	int len = sdev->inquiry_len;
 	/* first set us up for narrow async */
 	DV_SET(offset, 0);
@@ -844,6 +845,14 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
 		if (spi_min_period(starget) == 8)
 			DV_SET(pcomp_en, 1);
 	}
+	/* now that we've done all this, actually check the bus
+	 * signal type (if known).  Some devices are stupid on
+	 * a SE bus and still claim they can try LVD only settings */
+	if (i->f->get_signalling)
+		i->f->get_signalling(shost);
+	if (spi_signalling(shost) == SPI_SIGNAL_SE ||
+	    spi_signalling(shost) == SPI_SIGNAL_HVD)
+		DV_SET(dt, 0);
 	/* Do the read only INQUIRY tests */
 	spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len,
 		       spi_dv_device_compare_inquiry);