LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 11-28-2005, 11:05 PM   #1
gringer
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Rep: Reputation: 0
SCSI error: return code = 0x10000 on USB Mass Storage device


I'm running Debian (sid, custom compiled Debian kernel version 2.6.14) on an IBM Thinkpad R50, and have been having trouble getting an AMS Venus DS-2316SU2BK enclosure working. Here's a paste from /var/log/messages that indicates the basic error:

kernel: usb 4-4: new high speed USB device using ehci_hcd and address 22
kernel: scsi20 : SCSI emulation for USB Mass Storage devices
kernel: Vendor: ST325082 Model: 3AS Rev: 3.03
kernel: Type: Direct-Access ANSI SCSI revision: 04
kernel: SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
kernel: SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
kernel: sda:<7>usb-storage: queuecommand called
kernel: sda1 sda2
kernel: Attached scsi disk sda at scsi20, channel 0, id 0, lun 0
kernel: usb 4-4: USB disconnect, address 22
kernel: sd 20:0:0:0: SCSI error: return code = 0x10000
kernel: end_request: I/O error, dev sda, sector 488396928
kernel: printk: 8 messages suppressed.

The hard drive (Seagate Barracuda ST3250823AS) has been set up in XP with a 100GB NTFS partition, a 32GB FAT-32 partion, and the remainder not partitioned.

Things I have tried which have not solved the problem:
* compiled in usb-storage vs. module
* changing max_sectors in drivers/usb/storage/scsiglue.c to a lower number
(by commenting out if statement relating to USB_VENDOR_ID_GENESYS)
* different HDD (previously Hitachi Deskstar T7K250)
* different USB cable (cable that came with the enclosure, and another Hi-Speed cable I had lying around at home)
* previous kernel (2.6.12)

I see a few lines near the end of the debug output that look suspicious, particularly the one saying "Invalid command operation code":

Bulk status result = 0
Bulk Status S 0x53425355 T 0x8 R 0 Stat 0x0
-- Result from auto-sense is 0
-- code: 0x70, key: 0x5, ASC: 0x20, ASCQ: 0x0
Illegal Request: Invalid command operation code
scsi cmd done, result=0x2

I'll put the full debug output from one connect/disconnect cycle in a subsequent post.

lsmod is as follows:

Module Size Used by
ehci_hcd 37064 0
usb_storage 81072 16
radeon 110144 1
ntfs 109424 0
irtty_sir 9088 2
sir_dev 19500 1 irtty_sir
uhci_hcd 34320 0
piix 10692 0 [permanent]
usbcore 127616 4 ehci_hcd,usb_storage,uhci_hcd
irda 207804 2 irtty_sir,sir_dev

lspci:

0000:00:00.0 Host bridge: Intel Corporation 82855PM Processor to I/O Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corporation 82855PM Processor to AGP Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 01)
0000:00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]
0000:02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:00.2 FireWire (IEEE 1394): Texas Instruments: Unknown device 802a (rev 01)
0000:02:01.0 Ethernet controller: Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)
0000:02:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
 
Old 11-28-2005, 11:10 PM   #2
gringer
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Original Poster
Rep: Reputation: 0
Post Full debug output

As mentioned, here's the usb_storage debug output:

kernel: usb-storage:
USB Mass Storage device detected
-- associate_dev
Vendor: 0x0928, Product: 0x0002, Revision: 0x0000
Interface Subclass: 0x06, Protocol: 0x50
Transport: Bulk
Protocol: Transparent SCSI
usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1
GetMaxLUN command result is 1, data is 0
*** thread sleeping.
device found at 22
waiting for device to settle before scanning
queuecommand called
*** thread awakened.
Command INQUIRY (6 bytes)
12 00 00 00 24 00
Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries
Status code 0; transferred 36/36
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command TEST_UNIT_READY (6 bytes)
00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x2 L 0 F 0 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command READ_CAPACITY (10 bytes)
25 00 00 00 00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x3 L 8 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries
Status code 0; transferred 8/8
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command TEST_UNIT_READY (6 bytes)
00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x4 L 0 F 0 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command READ_CAPACITY (10 bytes)
25 00 00 00 00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x5 L 8 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries
Status code 0; transferred 8/8
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
*** thread awakened.
Command READ_10 (10 bytes)
28 00 00 00 00 00 00 00 08 00
Bulk Command S 0x43425355 T 0x6 L 4096 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
Status code 0; transferred 4096/4096
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command (unknown command) (12 bytes)
a0 00 00 00 00 00 00 00 10 00 00 00
Bulk Command S 0x43425355 T 0x7 L 4096 F 128 Trg 0 LUN 0 CL 12
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
Status code -32; transferred 0/4096
clearing endpoint halt for pipe 0xc0009680
usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=81 len=0
usb_stor_clear_halt: result = 0
Bulk data transfer result 0x2
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x7 R 4096 Stat 0x1
-- transport indicates command failure
-- unexpectedly short transfer
Issuing auto-REQUEST_SENSE
Bulk Command S 0x43425355 T 0x8 L 18 F 128 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_buf: xfer 18 bytes
Status code 0; transferred 18/18
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x8 R 0 Stat 0x0
-- Result from auto-sense is 0
-- code: 0x70, key: 0x5, ASC: 0x20, ASCQ: 0x0
Illegal Request: Invalid command operation code
scsi cmd done, result=0x2
*** thread sleeping.

# this next bit is repeated 7 times, with the number
# in Bad target number the only thing changing (1-7)
queuecommand called
*** thread awakened.
Bad target number (1:0)
scsi cmd done, result=0x40000
*** thread sleeping.

device scan complete
queuecommand called
*** thread awakened.
Command READ_10 (10 bytes)
28 00 1d 1c 58 80 00 00 08 00
Bulk Command S 0x43425355 T 0x9 L 4096 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
Status code 0; transferred 4096/4096
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code -71; transferred 0/13
-- unknown error
Bulk status result = 4
-- transport indicates error, resetting
storage_disconnect() called
usb_stor_stop_transport called
usb_reset_device returns -19
usb_stor_Bulk_reset called
No reset during disconnect
scsi cmd done, result=0x70000
queuecommand called
Fail command during disconnect
-- usb_stor_release_resources
-- sending exit command to thread
-- dissociate_dev
*** thread sleeping.
*** thread awakened.
-- exiting
 
Old 11-29-2005, 07:21 AM   #3
gringer
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Original Poster
Rep: Reputation: 0
For what it's worth, I think I've tracked down the segment of code that is producing the "Illegal Request: Invalid command operation code" error message (drivers/scsi/sr_ioctl.c, line ~149):

Code:
lines 149-159:
		case ILLEGAL_REQUEST:
    			err = -EIO;
    			if (sshdr.asc == 0x20 &&
    			    sshdr.ascq == 0x00)
    				/* sense: Invalid command operation code */
    				err = -EDRIVE_CANT_DO_THIS;
#ifdef DEBUG
			__scsi_print_command(cgc->cmd);
			scsi_print_sense_hdr("sr", &sshdr);
#endif
			break;
Not sure if this helps, but it does seem like the SCSI code as well as the USB code is involved here...
 
Old 11-29-2005, 07:17 PM   #4
gringer
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Original Poster
Rep: Reputation: 0
Lightbulb Accepted solution - disable REPORT_LUNS

Okay, I found a solution that seems to work so far (in that I can now access my FAT32 partition under Linux), using rough instructions from the following address:

http://64.62.136.189/linux-scsi@vger.../msg01260.html

According to that post, the error is related to the unknown command 0xA0...10..., which sends a REPORT_LUNS signal to the enclosure, resulting in badness. This is apparently because the device reports to be SCSI revision 04, but does not support all the commands. The solution is to stop the driver sending REPORT_LUNS to the enclosure. In my case, I did the following:
Code:
echo 'ST325082:3AS:0x01' > /proc/scsi/device_info
The generic solution (according to the last post by Patrick Mansfield on that thread) is the following, assuming that scsi_mod has been loaded (or compiled in):
Code:
echo "<vendor>:<model>:0x40000" > /proc/scsi/device_info
Where <vendor> and <model> are taken from the kernel messages when the device is plugged in. In my case:
Code:
kernel: usb 4-4: new high speed USB device using ehci_hcd and address 22
kernel: scsi20 : SCSI emulation for USB Mass Storage devices
kernel:   Vendor: ST325082  Model: 3AS          Rev: 3.03
kernel:   Type:   Direct-Access                 ANSI SCSI revision: 04

Last edited by gringer; 12-01-2005 at 08:45 PM.
 
Old 05-14-2007, 06:43 AM   #5
blue penguin
LQ Newbie
 
Registered: Dec 2004
Location: New Zealand
Distribution: Debian GNU/Linux (Etch) GRUB, Kubuntu 5.10 GRUB/GNU/Linux
Posts: 27

Rep: Reputation: 15
Arrow Possibly also with Laser SATA/USB2 external HDD case

Hello gringer,

This also may happen with the Laser SATA/USB2 external HDD case, at least for Linux kernel version 2.6.18. The behavior is a bit different, because I can write files to the drive (including a 12GB image), but it fails most of the time for writing lots of little files to the disk.

/var/log/messages output (showing vendor, model):

Code:
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: ST332062  Model: 0AS               Rev: K
  Type:   Direct-Access                      ANSI SCSI revision: 02
"fix" script:

Code:
# modprobe scsi_mod # creates /proc/scsi/device_info
# echo "ST332062:0AS:0x40000" > /proc/scsi/device_info
This has not been tested extensively yet, so I'm not really sure if it will work. On the other hand, I have now been able to finish some music tagging, which I was not able to complete before now (without the disk failing part way through).
 
  


Reply

Tags
enclosure, hdd, laser, sata


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mass storage device USB xeebeeeeeee Linux - Hardware 10 02-13-2008 12:11 PM
USB Mass storage Device purefan Linux - Hardware 15 06-06-2005 01:56 PM
usb - mass storage device d1l2w3 Mandriva 7 01-10-2005 10:10 PM
USB Mass Storage Device ebasi Linux - Hardware 2 12-23-2004 02:06 PM
Usb mass storage device laguna Linux - Hardware 4 08-12-2002 02:16 AM


All times are GMT -5. The time now is 08:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration