Re: [PATCH] tmscsim: INQUIRY always only untagged

Guennadi Liakhovetski
2004-09-06T08:50:48Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1867 bytes --]

On Mon, 5 Sep 2004, James Bottomley wrote:

> On Sun, 2004-09-05 at 12:31, Christoph Hellwig wrote:
>> Umm yes. But lets get the driver no oops first and then move forward.
>> There's still a lot of work to do on the driver.
>
> Well, OK. I agree to putting a palliative fix in, since what I
> suggested will probably take more thought, but I don't think this one is
> actually it. Mixing tagged and untagged commands is illegal under the
> SCSI spec. Simply untagging the INQUIRY command may work to fix this
> particular bug, but I bet it will introduce others when a scsi utility
> sends an INQUIRY down to an in-use device.

I've seen this done, at least, in one more driver - 53c700.c. In its
queuecommand it checks not to mix tagged and untagged commands, but allows
both. That is, it checks, if there are currently (tagged) commands on the
queue and if the new one is untagged, and if so, returns DEVICE_BUSY. So,
it would accept an untagged command to a device, supporting tags, but
currently having the queue empty. I am doing the same check in the latest
version of my patch. Is it still bad?

> I think perhaps the correct palliative fix is simply to list this device
> (whatever it is, it's not listed in the bug report) as BLIST_NOTQ, then
> the problem won't arise (and of course, tmscsim would have actually to
> use the mid-layer black list rather than its own much shorter internal
> list).

I don't know what device the original reporter had, but the one I have
here, which exibits the same behaviour, is a Seagate disk (see attached
patch). So, if you still think, this device should not be allowed any tags
(which is a pity, I would then again have no device with tags supported
for tests here:-(), then, please, apply the attached patch. A patch to use
the blacklist will follow shortly.

Thanks
Guennadi
---
Guennadi Liakhovetski

[-- Attachment #2: Type: TEXT/PLAIN, Size: 652 bytes --]

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

diff -u a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
--- a/drivers/scsi/scsi_devinfo.c Mon Sep 6 10:37:08 2004
+++ b/drivers/scsi/scsi_devinfo.c Mon Sep 6 10:36:30 2004
@@ -181,6 +181,7 @@
{"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
{"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
{"SEAGATE", "ST3390N", "9546", BLIST_NOTQ},
+ {"SEAGATE", "ST34555N", "0930", BLIST_NOTQ}, /* Chokes on tagged INQUIRY */
{"SGI", "RAID3", "*", BLIST_SPARSELUN},
{"SGI", "RAID5", "*", BLIST_SPARSELUN},
{"SGI", "TP9100", "*", BLIST_REPORTLUN2},