aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_spi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-12-02 14:32:44 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-02 14:32:44 -0800
commit2741049e66d9698da5e0c90c849406fa3d3fc45c (patch)
tree725c927121ccfe3eaa7df3b9b8e46610805f6b15 /drivers/scsi/scsi_transport_spi.c
parent2a298a35ebe060a6f2b06b20c2a34ea188ddfd37 (diff)
parent4d5cda069b3f0a3bbc18576bc15903ed665d0295 (diff)
downloadkernel_samsung_smdk4412-2741049e66d9698da5e0c90c849406fa3d3fc45c.zip
kernel_samsung_smdk4412-2741049e66d9698da5e0c90c849406fa3d3fc45c.tar.gz
kernel_samsung_smdk4412-2741049e66d9698da5e0c90c849406fa3d3fc45c.tar.bz2
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r--drivers/scsi/scsi_transport_spi.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 718a2bc..38a53b5 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -812,12 +812,10 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
if (!scsi_device_sync(sdev) && !scsi_device_dt(sdev))
return;
- /* see if the device has an echo buffer. If it does we can
- * do the SPI pattern write tests */
-
- len = 0;
- if (scsi_device_dt(sdev))
- len = spi_dv_device_get_echo_buffer(sdev, buffer);
+ /* len == -1 is the signal that we need to ascertain the
+ * presence of an echo buffer before trying to use it. len ==
+ * 0 means we don't have an echo buffer */
+ len = -1;
retry:
@@ -840,11 +838,23 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
if (spi_min_period(starget) == 8)
DV_SET(pcomp_en, 1);
}
+ /* Do the read only INQUIRY tests */
+ spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len,
+ spi_dv_device_compare_inquiry);
+ /* See if we actually managed to negotiate and sustain DT */
+ if (i->f->get_dt)
+ i->f->get_dt(starget);
+
+ /* see if the device has an echo buffer. If it does we can do
+ * the SPI pattern write tests. Because of some broken
+ * devices, we *only* try this on a device that has actually
+ * negotiated DT */
+
+ if (len == -1 && spi_dt(starget))
+ len = spi_dv_device_get_echo_buffer(sdev, buffer);
- if (len == 0) {
+ if (len <= 0) {
starget_printk(KERN_INFO, starget, "Domain Validation skipping write tests\n");
- spi_dv_retrain(sdev, buffer, buffer + len,
- spi_dv_device_compare_inquiry);
return;
}