From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Örjan Nordlund" <orjan.nordlund@gmail.com>,
"SCSI development list" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] SCSI: detect missing data for INQUIRY
Date: Mon, 27 Oct 2008 11:37:55 -0500 [thread overview]
Message-ID: <1225125475.5146.24.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0810271212130.2296-100000@iolanthe.rowland.org>
On Mon, 2008-10-27 at 12:18 -0400, Alan Stern wrote:
> This patch (as1154) fixes a problem in scsi_probe_lun(): The function
> doesn't check whether the device has actually sent back any INQUIRY
> data! The patch adds a test to see if the result buffer is still
> empty after the command has been executed.
>
> This enables the Thecus N2050 storage device to work. The firmware on
> that device starts up strangely; it sends no data in response to the
> initial INQUIRY, and it sends the INQUIRY information in response to
> the followup REQUEST SENSE! But after that it works better, so
> retrying the INQUIRY is enough to get it going.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
>
> ---
>
> This should get into 2.6.28.
>
>
> Index: usb-2.6/drivers/scsi/scsi_scan.c
> ===================================================================
> --- usb-2.6.orig/drivers/scsi/scsi_scan.c
> +++ usb-2.6/drivers/scsi/scsi_scan.c
> @@ -602,6 +602,13 @@ static int scsi_probe_lun(struct scsi_de
> (sshdr.ascq == 0))
> continue;
> }
> + } else {
> + /*
> + * Additional Length and Vendor fields missing
> + * probably means nothing was transferred. Try again.
> + */
> + if (inq_result[4] == 0 && inq_result[8] == 0)
> + continue;
Really, no.
A legitimate minimal response from a device is zero in the additional
length field. If it does that, then the vendor field is bound to be
zero as well.
About the best we can do is check the first four fields. For them to be
all zero, it would have to be a minimal response SCSI-1 device (RDF of
zero) ... hopefully they're all dead by now.
James
next prev parent reply other threads:[~2008-10-27 16:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-27 16:18 [PATCH] SCSI: detect missing data for INQUIRY Alan Stern
2008-10-27 16:37 ` James Bottomley [this message]
2008-10-27 17:00 ` Alan Stern
2008-10-27 17:08 ` James Bottomley
2008-10-27 17:27 ` Alan Stern
2008-10-27 17:29 ` James Bottomley
2008-10-27 18:53 ` [PATCH v2] " Alan Stern
2008-10-28 13:02 ` James Smart
2008-10-28 13:43 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1225125475.5146.24.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=orjan.nordlund@gmail.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox