linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [usb-storage] [Merging ATA passthru] on integrating SMART/ATA-Security in usb-storage driver
@ 2005-11-08 19:50 Timothy Thelin
  2005-11-09  9:04 ` thomas schorpp
  0 siblings, 1 reply; 12+ messages in thread
From: Timothy Thelin @ 2005-11-08 19:50 UTC (permalink / raw)
  To: Alan Stern, James Bottomley
  Cc: Patrick Mansfield, Matthew Dharm, thomas schorpp,
	USB Storage list, Linux SCSI list, linux-ide

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]


> On Mon, 7 Nov 2005, James Bottomley wrote:
> 
> > > It's quite possible that usb-storage no longer needs to force the 
> > > scsi-level to 2.  No one has recently tested what would 
> happen without 
> > > it.  Matt probably has the best selection of devices for 
> testing...
> > > 
> > > There is one problem we have with devices that report 
> themselves as SCSI-3 
> > > or SCSI-4 but hang when they receive a REPORT LUNS 
> command.  That's easily 
> > > handled by making usb-storage set the NOREPORTLUN flag.  
> Maybe that's all 
> > > we need to do.
> > 
> > If you could try this out, I'd be grateful.
> 
> I tried the patch below on several combinations of SCSI 
> levels and device 
> types.  It seems to do exactly what we want; for reads I always saw 
> READ(10) and for MODE SENSE I saw either the 6- or 10-byte 
> form, depending 
> on the device type and USB subclass value.
> 
> The question remains whether pass-thru will now work and 
> whether the patch
> will mess up some existing non-compliant device that 
> currently works okay.  
> The only way to know is by trying it out.  Matt and Timothy, 
> that's up to
> you.
> 
> Alan Stern
> 

I did some initial testing on Alan's patch with a sandisk cruzer
mini thumb drive (level 2), a memorex thumb drive (level 0),
and that cypress part (level 0), and I haven't seen any IO
problems.

After that I made another patch (below and attached because
of wrapping) you can apply after Alan's that disables cdb mangling
on level 0 devices. It was generated against Linus' git repo after
applying Alan's patch.

With both patches applied I can now do passthru cdbs on the
cypress part without issue, and I still don't see any IO issues.

Anyone out there have a better selection of hardware to test with?


Signed-off-by: Timothy Thelin <timothy.thelin@wdc.com>

---

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -569,9 +569,10 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
 	}
 
 	/* 
-	 * If SCSI-2 or lower, store the LUN value in cmnd.
+	 * If SCSI-2 or lower (except SCSI-0), store the LUN value in cmnd.
 	 */
-	if (cmd->device->scsi_level <= SCSI_2) {
+	if (cmd->device->scsi_level != SCSI_UNKNOWN &&
+		cmd->device->scsi_level <= SCSI_2) {
 		cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
 			       (cmd->device->lun << 5 & 0xe0);
 	}

[-- Attachment #2: scsi-level-0-aware.patch --]
[-- Type: application/octet-stream, Size: 532 bytes --]

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -569,9 +569,10 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
 	}
 
 	/* 
-	 * If SCSI-2 or lower, store the LUN value in cmnd.
+	 * If SCSI-2 or lower (except SCSI-0), store the LUN value in cmnd.
 	 */
-	if (cmd->device->scsi_level <= SCSI_2) {
+	if (cmd->device->scsi_level != SCSI_UNKNOWN &&
+		cmd->device->scsi_level <= SCSI_2) {
 		cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
 			       (cmd->device->lun << 5 & 0xe0);
 	}

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

end of thread, other threads:[~2005-11-20  7:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-08 19:50 [usb-storage] [Merging ATA passthru] on integrating SMART/ATA-Security in usb-storage driver Timothy Thelin
2005-11-09  9:04 ` thomas schorpp
2005-11-09  9:45   ` thomas schorpp
2005-11-09 10:05     ` thomas schorpp
2005-11-09 13:21     ` Mark Lord
2005-11-09 14:05       ` thomas schorpp
     [not found]         ` <4372172A.50003@gmx.de>
     [not found]           ` <43721C3C.1010103@pobox.com>
     [not found]             ` <1131553363.3271.1.camel@mulgrave>
2005-11-10  6:19               ` [DOC PATCH] T10/04-262r8 thomas schorpp
2005-11-10  7:44                 ` Jeff Garzik
2005-11-10 14:27                 ` Mark Lord
2005-11-10 15:05                   ` (SAT) libata + hdparm/smartctl thomas schorpp
2005-11-20  7:10                     ` Douglas Gilbert
2005-11-10 15:58                 ` [DOC PATCH] T10/04-262r8 James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).