Skip to contentSkip to conversation

USB harddrive not working (2.4, 2.5)

DISCUSSION Andrey Panin 3 participants 4 messages Mar 19, 2003 – Mar 24, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

ISD200 based hard drive bay doesn't work with 2.4 & 2.5, can someone assist me with it?

Kernel message log appended.

Best regards.

Signature · 2 lines
Andrey Panin		| Embedded systems software developer
[email protected]	| PGP key: wwwkeys.pgp.net

drivers/usb/core/usb.c: registered new driver hub drivers/usb/host/uhci-hcd.c: USB Universal Host Controller Interface driver v2.0
PCI: Found IRQ 11 for device 00:1f.2
PCI: Setting latency timer of device 00:1f.2 to 64
uhci-hcd 00:1f.2: Intel Corp. 82801AA USB
uhci-hcd 00:1f.2: irq 11, io base 0000d000
uhci-hcd 00:1f.2: new USB bus registered, assigned bus number 1
hub 1-0:0: USB hub found
hub 1-0:0: 2 ports detected
hub 1-0:0: debounce: port 2: delay 100ms stable 4 status 0x101
hub 1-0:0: new USB device on port 2, assigned address 2 Initializing USB Mass Storage driver...

usb-storage: act_altsetting is 0
usb-storage: id_index calculated to be: 32
usb-storage: Array length appears to be: 81
usb-storage: Vendor: In-System
usb-storage: Product: USB/IDE Bridge (ATA/ATAPI)
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xc336b934 Out: 0xc336b920 Int: 0xc336b948 (Period 32)
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: Transport: Bulk
usb-storage: Protocol: ISD200 ATA/ATAPI
usb-storage: Allocating usb_ctrlrequest
usb-storage: Allocating URB
usb-storage: Allocating scatter-gather request block
usb-storage: ISD200 Initialization...
usb-storage: Entering isd200_get_inquiry_data
usb-storage: Entering isd200_manual_enum
usb-storage: Entering isd200_read_config
usb-storage: usb_stor_ctrl_transfer(): rq=02 rqtype=c0 value=0000 index=02 len=8
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage:    Retrieved the following ISD200 Config Data:
usb-storage:       Event Notification: 0x0
usb-storage:       External Clock: 0x0
usb-storage:       ATA Init Timeout: 0x19
usb-storage:       ATAPI Command Block Size: 0x0
usb-storage:       Master/Slave Selection: 0x0
usb-storage:       ATAPI Reset: 0x0
usb-storage:       ATA Timing: 0x1
usb-storage:       ATA Major Command: 0x24
usb-storage:       ATA Minor Command: 0x24
usb-storage:       Init Status: 0x0
usb-storage:       Config Descriptor 2: 0x0
usb-storage:       Skip Device Boot: 0x0
usb-storage:       ATA 3 State Supsend: 0x0
usb-storage:       Descriptor Override: 0x8
usb-storage:       Last LUN Identifier: 0x0
usb-storage:       SRST Enable: 0x0
usb-storage: Leaving isd200_read_config 00000000
usb-storage:    isd200_action(ENUM,0xa0)
usb-storage: Bulk command S 0x43425355 T 0x0 Trg 0 LUN 1 L 0 F 0 CL 0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13
usb-storage: clearing endpoint halt for pipe 0xc0010280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Attempting to get CSW (2nd try)...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13
usb-storage: clearing endpoint halt for pipe 0xc0010280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Bulk status result = 2
usb-storage:    isd200_action(0x04) error: 2
usb-storage:    Setting Master/Slave selection to 0
usb-storage: Entering isd200_write_config
usb-storage:    Writing the following ISD200 Config Data:
usb-storage:       Event Notification: 0x0
usb-storage:       External Clock: 0x0
usb-storage:       ATA Init Timeout: 0x19
usb-storage:       ATAPI Command Block Size: 0x0
usb-storage:       Master/Slave Selection: 0x0
usb-storage:       ATAPI Reset: 0x0
usb-storage:       ATA Timing: 0x1
usb-storage:       ATA Major Command: 0x24
usb-storage:       ATA Minor Command: 0x24
usb-storage:       Init Status: 0x0
usb-storage:       Config Descriptor 2: 0x0
usb-storage:       Skip Device Boot: 0x0
usb-storage:       ATA 3 State Supsend: 0x0
usb-storage:       Descriptor Override: 0x8
usb-storage:       Last LUN Identifier: 0x0
usb-storage:       SRST Enable: 0x0
usb-storage: usb_stor_ctrl_transfer(): rq=01 rqtype=40 value=0000 index=02 len=8
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage:    ISD200 Config Data was written successfully
usb-storage: Leaving isd200_write_config 00000000
usb-storage: Leaving isd200_manual_enum 00000000
usb-storage: Protocol changed to: Transparent SCSI
usb-storage: Leaving isd200_get_inquiry_data 00000000
usb-storage: ISD200 Initialization complete
usb-storage: *** thread sleeping.
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk command S 0x43425355 T 0x1 Trg 0 LUN 0 L 36 F 128 CL 6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code -32; transferred 31/31
usb-storage: clearing endpoint halt for pipe 0xc0008200
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Bulk command transfer result=2
usb-storage: -- transport indicates error, resetting
usb-storage: Bulk reset requested
usb-storage: command_abort() called
usb-storage: usb_stor_abort_transport called
usb-storage: Soft reset: clearing bulk-in endpoint halt
usb-storage: Soft reset: clearing bulk-out endpoint halt
usb-storage: Soft reset done
usb-storage: scsi cmd done, result=0x70000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage:  00 00 00 00 00 00
usb-storage: Bulk command S 0x43425355 T 0x1 Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x1 R 0 Stat 0x2
usb-storage: -- transport indicates error, resetting
usb-storage: Bulk reset requested
usb-storage: command_abort() called
usb-storage: usb_stor_abort_transport called
usb-storage: Soft reset: clearing bulk-in endpoint halt
usb-storage: Soft reset: clearing bulk-out endpoint halt
usb-storage: Soft reset done
usb-storage: scsi cmd done, result=0x70000
usb-storage: *** thread sleeping.
usb-storage: device_reset() called
usb-storage: Bulk reset requested
usb-storage: Soft reset: clearing bulk-in endpoint halt
usb-storage: Soft reset: clearing bulk-out endpoint halt
usb-storage: Soft reset done
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage:  00 00 00 00 00 00
usb-storage: Bulk command S 0x43425355 T 0x1 Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x1 R 0 Stat 0x2
usb-storage: -- transport indicates error, resetting
usb-storage: Bulk reset requested
usb-storage: command_abort() called
usb-storage: usb_stor_abort_transport called
usb-storage: Soft reset: clearing bulk-in endpoint halt
usb-storage: Soft reset: clearing bulk-out endpoint halt
usb-storage: Soft reset done
usb-storage: scsi cmd done, result=0x70000
usb-storage: *** thread sleeping.
usb-storage: bus_reset() called
drivers/usb/core/hub.c: USB device not accepting new address (error=-22)
usb-storage: usb_reset_device returns -22
scsi: Device offlined - not ready after error recovery: host 0 channel 0 id 0 lun 0
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (1/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (2/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (3/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (4/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (5/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (6/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (7/0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
WARNING: USB Mass Storage data integrity not assured

USB Mass Storage device found at 2 drivers/usb/core/usb.c: registered new driver usb-storage USB Mass Storage support registered.

#1 lore raw

The error "USB device not accepting new address" can sometimes be a symptom of an interrupt problem. Do you see interrupts increasing for this device in /proc/interrupts? There is some more info on this in the FAQ at
http://www.linux-usb.org .

Quoted 10 lines · Andrey Panin

Hi,

ISD200 based hard drive bay doesn't work with 2.4 & 2.5, can someone assist me with it?

Kernel message log appended.

Best regards.

Signature · 6 lines
 /------------------------------------+-------------------------\
|Stephen J. Gowdy                     | SLAC, MailStop 34,       |
|http://www.slac.stanford.edu/~gowdy/ | 2575 Sand Hill Road,     |
|http://calendar.yahoo.com/gowdy      | Menlo Park CA 94025, USA |
|EMail: [email protected]       | Tel: +1 650 926 3144     |
 \------------------------------------+-------------------------/
#2 lore raw
In reply to Andrey Panin
Quoted 4 lines · Andrey Panin

Hi,

ISD200 based hard drive bay doesn't work with 2.4 & 2.5, can someone assist me with it?

This looks like the same problem I was seeing with my Archos. The initial probes for ATA devices fail and the driver falls back to 'transparent scsi mode', where it passes everything along unchanged. Probably works fine when an ATAPI device is attached, but not with my drive.

Quoted 9 lines

usb-storage: isd200_action(ENUM,0xa0)
usb-storage: Bulk command S 0x43425355 T 0x0 Trg 0 LUN 1 L 0 F 0 CL 0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13

The isd200 driver is not correctly initializing the srb.cmd_len field, which is the main reason why things fail. I also noticed that the usb_stor_bulk functions are interpreting the ATA commands as if they were scsi, so the packet was sent to the wrong lun, but that might not really matter much.

Here is a patch agains 2.5.64 that fixes both of these problems for me. It will probably apply to 2.5.65 as well.

Jan

usb/storage/isd200.c renamed from usb/storage/isd200.c.orig +5 -0
@@ -405,11 +405,14 @@
 {
 	union ata_cdb ata;
 	struct scsi_cmnd srb;
+	struct scsi_device srb_dev;
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	int status;
 
 	memset(&ata, 0, sizeof(ata));
 	memset(&srb, 0, sizeof(srb));
+	memset(&srb_dev, 0, sizeof(srb_dev));
+	srb.device = &srb_dev;
 
 	ata.generic.SignatureByte0 = info->ConfigData.ATAMajorCommand;
 	ata.generic.SignatureByte1 = info->ConfigData.ATAMinorCommand;
@@ -479,6 +482,7 @@
 	}
 
 	memcpy(srb.cmnd, &ata, sizeof(ata.generic));
+	srb.cmd_len = sizeof(ata.generic);
 	status = usb_stor_Bulk_transport(&srb, us);
 	if (status == USB_STOR_TRANSPORT_GOOD)
 		status = ISD200_GOOD;
@@ -538,6 +542,7 @@
 	/* send the command to the transport layer */
 	srb->resid = 0;
 	memcpy(srb->cmnd, ataCdb, sizeof(ataCdb->generic));
+	srb->cmd_len = sizeof(ataCdb->generic);
 	transferStatus = usb_stor_Bulk_transport(srb, us);
 
 	/* if the command gets aborted by the higher layers, we need to
usb/storage/transport.c renamed from usb/storage/transport.c.orig +1 -1
@@ -893,7 +893,7 @@
 	bcb.DataTransferLength = cpu_to_le32(transfer_length);
 	bcb.Flags = srb->sc_data_direction == SCSI_DATA_READ ? 1 << 7 : 0;
 	bcb.Tag = srb->serial_number;
-	bcb.Lun = srb->cmnd[1] >> 5;
+	bcb.Lun = srb->device->lun;
 	if (us->flags & US_FL_SCM_MULT_TARG)
 		bcb.Lun |= srb->device->id << 4;
 	bcb.Length = srb->cmd_len;
#3 lore raw
Quoted 22 lines · Jan Harkes
Quoted 4 lines · Andrey Panin

Hi,

ISD200 based hard drive bay doesn't work with 2.4 & 2.5, can someone assist me with it?

This looks like the same problem I was seeing with my Archos. The initial probes for ATA devices fail and the driver falls back to 'transparent scsi mode', where it passes everything along unchanged. Probably works fine when an ATAPI device is attached, but not with my drive.

Quoted 9 lines

usb-storage: isd200_action(ENUM,0xa0)
usb-storage: Bulk command S 0x43425355 T 0x0 Trg 0 LUN 1 L 0 F 0 CL 0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13

Quoted 8 lines

The isd200 driver is not correctly initializing the srb.cmd_len field, which is the main reason why things fail. I also noticed that the usb_stor_bulk functions are interpreting the ATA commands as if they were scsi, so the packet was sent to the wrong lun, but that might not really matter much.

Here is a patch agains 2.5.64 that fixes both of these problems for me. It will probably apply to 2.5.65 as well.

I don't have this drive at this time, but i'll test your patch and report results ASAP.

Signature · 2 lines
Andrey Panin		| Embedded systems software developer
[email protected]	| PGP key: wwwkeys.pgp.net