Subject: Re: kern/37403: USB tape drive Illegal Requests for any use
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 12/02/2007 19:35:03
The following reply was made to PR kern/37403; it has been noted by GNATS.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/37403: USB tape drive Illegal Requests for any use
Date: Sun, 2 Dec 2007 20:30:38 +0100

 On Mon, Nov 19, 2007 at 09:20:00AM +0000, jpeterson275@comcast.net wrote:
 > >Number:         37403
 > >Category:       kern
 > >Synopsis:       USB tape drive Illegal Requests for any use
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       high
 > >Responsible:    kern-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Mon Nov 19 09:20:00 +0000 2007
 > >Originator:     Jesse Peterson
 > >Release:        NetBSD/amd64 4.0_RC4
 > >Organization:
 > >Environment:
 > NetBSD localhost 4.0_RC4 NetBSD 4.0_RC4 (GENERIC) #0: Thu Nov  8 00:11:53 PST 2007  builds@wb28:/home/builds/ab/netbsd-4-0-RC4/amd64/200711080452Z-obj/home/builds/ab/netbsd-4-0-RC4/src/sys/arch/amd64/compile/GENERIC amd64
 > >Description:
 > This is an ATAPI Sony AIT-1 drive (SDX-420C) connected through a USB->ATAPI bridge in a LaCie enclosure.
 > 
 > When attempting to issue basic mt(1) commands such as rewind and offline etc. I typically get these errors:
 > 
 > # mt rewind
 > mt: /dev/nrst0: Invalid argument
 > 
 > Looking through the kernel messages these show up:
 > 
 > Nov 18 22:38:57 localhost /netbsd: st0(umass0:0:0:0):  Check Condition on CDB: 0x15 00 00 00 0c 00
 > Nov 18 22:38:57 localhost /netbsd: SENSE KEY:  Illegal Request
 > Nov 18 22:38:57 localhost /netbsd: ASC/ASCQ:  Invalid Field In Parameter List
 > Nov 18 22:38:57 localhost /netbsd: SKSV:  Error in Parameters, Offset 9
 > Nov 18 22:38:57 localhost /netbsd: 
 > Nov 18 22:38:57 localhost /netbsd: st0: cannot set selected mode
 > 
 > The same error happens for any command or any use (such as with tar, etc.) for this drive. It gets detected as such:
 > 
 > Nov 18 22:37:59 localhost /netbsd: umass0 at uhub4 port 2 configuration 2 interface 0
 > Nov 18 22:37:59 localhost /netbsd: 
 > Nov 18 22:38:00 localhost /netbsd: umass0: LaCie LaCie StudioDrive USB2, rev 2.00/11.06, addr 2
 > Nov 18 22:38:00 localhost /netbsd: umass0: using SCSI over Bulk-Only
 > Nov 18 22:38:00 localhost /netbsd: scsibus0 at umass0: 2 targets, 1 lun per target
 > Nov 18 22:38:05 localhost /netbsd: st0 at scsibus0 target 0 lun 0: <SONY, SDX-420C, 0103> tape removable
 > Nov 18 22:38:05 localhost /netbsd: st0: 
 > Nov 18 22:38:43 localhost /netbsd: density code 48, 512-byte blocks, write-enabled
 
 The problem here is that the drive appear as SCSI to the system, while it's
 really an ATAPI drive. A few things have to be handled differently between
 SCSI and ATAPI drives, and in your case the wrong code is used.
 I don't know how to handle it in the driver, as there's nothing to tell
 us here that it's an ATAPI device in an enclosure that makes it appear as
 SCSI. It would probably work if it was in an USB enclosure using the UFI
 or ATAPI protocol ...
 
 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --