Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb1dd68b authored by James Bottomley's avatar James Bottomley Committed by James Bottomley
Browse files

[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: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 2a40342e
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -795,7 +795,8 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
	}

	/* test width */
	if (i->f->set_width && spi_max_width(starget) && sdev->wdtr) {
	if (i->f->set_width && spi_max_width(starget) &&
	    scsi_device_wide(sdev)) {
		i->f->set_width(starget, 1);

		if (spi_dv_device_compare_inquiry(sreq, buffer,
@@ -811,14 +812,14 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
		return;

	/* device can't handle synchronous */
	if (!sdev->ppr && !sdev->sdtr)
	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 (sdev->ppr)
	if (scsi_device_dt(sdev))
		len = spi_dv_device_get_echo_buffer(sreq, buffer);

 retry:
@@ -828,8 +829,10 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
	DV_SET(period, spi_min_period(starget));
	/* try QAS requests; this should be harmless to set if the
	 * target supports it */
	if (scsi_device_qas(sdev))
		DV_SET(qas, 1);
	/* Also try IU transfers */
	if (scsi_device_ius(sdev))
		DV_SET(iu, 1);
	if (spi_min_period(starget) < 9) {
		/* This u320 (or u640). Ignore the coupled parameters