aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-07-02 12:22:01 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-07-11 18:04:43 -0400
commiteb1dd68bc897d4e5a5133bfffbd4777a0fe16c4c (patch)
treec09328dade56919dbcd838ed5bc51143a04ce67a /drivers
parent2a40342e0e72a2ba89aaa9e6c9a9eceb04741b24 (diff)
[SCSI] SPI transport class, don't negotiate options not supported
At the moment, the transport class blindly tries to set things like QAS and IU, even if the drive won't support them. It's best not to annoy the devices like this and instead only set what the drive says is actually supported. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_transport_spi.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 2918b9600db7..7670919a087a 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -795,7 +795,8 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
795 } 795 }
796 796
797 /* test width */ 797 /* test width */
798 if (i->f->set_width && spi_max_width(starget) && sdev->wdtr) { 798 if (i->f->set_width && spi_max_width(starget) &&
799 scsi_device_wide(sdev)) {
799 i->f->set_width(starget, 1); 800 i->f->set_width(starget, 1);
800 801
801 if (spi_dv_device_compare_inquiry(sreq, buffer, 802 if (spi_dv_device_compare_inquiry(sreq, buffer,
@@ -811,14 +812,14 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
811 return; 812 return;
812 813
813 /* device can't handle synchronous */ 814 /* device can't handle synchronous */
814 if (!sdev->ppr && !sdev->sdtr) 815 if (!scsi_device_sync(sdev) && !scsi_device_dt(sdev))
815 return; 816 return;
816 817
817 /* see if the device has an echo buffer. If it does we can 818 /* see if the device has an echo buffer. If it does we can
818 * do the SPI pattern write tests */ 819 * do the SPI pattern write tests */
819 820
820 len = 0; 821 len = 0;
821 if (sdev->ppr) 822 if (scsi_device_dt(sdev))
822 len = spi_dv_device_get_echo_buffer(sreq, buffer); 823 len = spi_dv_device_get_echo_buffer(sreq, buffer);
823 824
824 retry: 825 retry:
@@ -828,9 +829,11 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
828 DV_SET(period, spi_min_period(starget)); 829 DV_SET(period, spi_min_period(starget));
829 /* try QAS requests; this should be harmless to set if the 830 /* try QAS requests; this should be harmless to set if the
830 * target supports it */ 831 * target supports it */
831 DV_SET(qas, 1); 832 if (scsi_device_qas(sdev))
833 DV_SET(qas, 1);
832 /* Also try IU transfers */ 834 /* Also try IU transfers */
833 DV_SET(iu, 1); 835 if (scsi_device_ius(sdev))
836 DV_SET(iu, 1);
834 if (spi_min_period(starget) < 9) { 837 if (spi_min_period(starget) < 9) {
835 /* This u320 (or u640). Ignore the coupled parameters 838 /* This u320 (or u640). Ignore the coupled parameters
836 * like DT and IU, but set the optional ones */ 839 * like DT and IU, but set the optional ones */