Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14939
b: refs/heads/master
c: 349cd7c
h: refs/heads/master
i:
  14937: 65e7933
  14935: 4f8a571
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Dec 1, 2005
1 parent 434ecb1 commit 4c6bb3a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dce200670d63615120de17d4aed0a4fd777cc825
refs/heads/master: 349cd7cfe6ba0b2e7cd2afdc3e70ede845311afe
28 changes: 19 additions & 9 deletions trunk/drivers/scsi/scsi_transport_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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;
}

Expand Down

0 comments on commit 4c6bb3a

Please sign in to comment.