public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: detect missing data for INQUIRY
@ 2008-10-27 16:18 Alan Stern
  2008-10-27 16:37 ` James Bottomley
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Stern @ 2008-10-27 16:18 UTC (permalink / raw)
  To: James Bottomley; +Cc: Örjan Nordlund, SCSI development list

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;
 		}
 		break;
 	}


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH v2] SCSI: detect missing data for INQUIRY
@ 2008-12-03 17:44 Alan Stern
  2008-12-03 18:00 ` James Bottomley
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Stern @ 2008-12-03 17:44 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI development list

James:

There hasn't been any feedback on this patch:

	http://marc.info/?l=linux-scsi&m=122513368301598&w=2

It was modified in the way you requested.  Does it need to be revised 
any more?

Alan Stern


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-12-03 18:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox