public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <James.Smart@Emulex.Com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "James Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Örjan Nordlund" <orjan.nordlund@gmail.com>,
	"SCSI development list" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v2] SCSI: detect missing data for INQUIRY
Date: Tue, 28 Oct 2008 09:02:27 -0400	[thread overview]
Message-ID: <49070D63.6050706@emulex.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0810271452540.2296-100000@iolanthe.rowland.org>

Checking the payload like this is really hokey - but probably works.
Have we lost all notion from the LLDD on what the actual payload length 
was (calculated by expected transfer length and resid) ?  Seems like a 
much better idea than just checking contents.

-- james s

Alan Stern wrote:
> This patch (as1154b) 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>
> 
> ---
> 
> 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,14 @@ static int scsi_probe_lun(struct scsi_de
>                                     (sshdr.ascq == 0))
>                                         continue;
>                         }
> +               } else {
> +                       /*
> +                        * If the first four bytes are all 0 then probably
> +                        * nothing was transferred.  Try again.
> +                        */
> +                       if ((inq_result[0] | inq_result[1] |
> +                                       inq_result[2] | inq_result[3]) == 0)
> +                               continue;
>                 }
>                 break;
>         }
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2008-10-28 13:09 UTC|newest]

Thread overview: 13+ 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
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 [this message]
2008-10-28 13:43               ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2008-12-03 17:44 Alan Stern
2008-12-03 18:00 ` James Bottomley
2008-12-03 18:18   ` Alan Stern
2008-12-03 18:46     ` Boaz Harrosh

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=49070D63.6050706@emulex.com \
    --to=james.smart@emulex.com \
    --cc=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