SG_IO v3 "ATA IDENTIFY DEVICE" command from ata_id hoses bridge

Bug #982213 reported by Tormod Volden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have Ubuntu 12.04 installed on an external hard drive, where the disk enclosure has a Cypress CY7C68300A EZ-USB AT2 USB 2.0 to ATA/ATAPI bridge.

At boot, the udev rules probes the drive with /lib/udev/ata_id and this makes the bridge lock up and the disk unavailable. After 30 seconds a scsi reset is issued and the drive comes back. I have traced this down to the "v3" fallback of extras/ata_id/ata_id.c:187. When patching this ioctl away everything is fine.

Another workaround would be to change the udev rules to not call ata_id when this particular bridge is detected. ata_id does not return anything for this drive on my setup anyway.

lsusb:
Bus 002 Device 003: ID 04b4:6830 Cypress Semiconductor Corp. CY7C68300A EZ-USB AT2 USB 2.0 to ATA/ATAPI

Revision history for this message
Tormod Volden (tormodvolden) wrote :
Revision history for this message
Tormod Volden (tormodvolden) wrote :
Revision history for this message
Tormod Volden (tormodvolden) wrote :

BTW, (with or without my patch) runnig ata_id on my drive makes udev log this:
ata_id[5678]: HDIO_GET_IDENTITY failed for '/dev/sdb': Invalid argument

Revision history for this message
Tormod Volden (tormodvolden) wrote :

So this is what ata_id is up to:

disk_scsi_inquiry_command trying v4
disk_scsi_inquiry_command trying v3
disk_identify_command trying v4
disk_identify_command trying v3
 *the latter sends 0xEC via cypress_atacb.c and it hangs
main trying HDIO_GET_IDENTITY
 *that fails with "Invalid argument"

I found out that my hdparm trouble in bug #428469 is caused by the same atacb commands. I have been using "nohdparm" for years.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

debug from drivers/usb/storage/transport.c

 [ 166.745112] cypress_atacb.c sending command ec
 [ 166.745117] usb-storage: Bulk Command S 0x43425355 T 0x16 L 512 F 128 Trg 0 LUN 0 CL 16
 [ 166.745120] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
 [ 166.745196] usb-storage: Status code 0; transferred 31/31
 [ 166.745199] usb-storage: -- transfer complete
 [ 166.745202] usb-storage: Bulk command transfer result=0
 [ 166.745205] usb-storage: usb_stor_bulk_transfer_sglist: xfer 512 bytes, 1 entries
 [ 166.745318] usb-storage: Status code -121; transferred 13/512
 [ 166.745321] usb-storage: -- short read transfer
 [ 166.745324] usb-storage: Bulk data transfer result 0x1
 [ 166.745326] usb-storage: Attempting to get CSW...
 [ 166.745329] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
 [ 197.549055] usb-storage: usb_stor_stop_transport called
 [ 197.549059] usb-storage: -- cancelling URB
 [ 197.549181] usb-storage: Status code -104; transferred 0/13
 [ 197.549184] usb-storage: -- transfer cancelled
 [ 197.549187] usb-storage: Bulk status result = 4
 [ 197.549190] us->transport returned 0x03
 [ 197.549192] usb-storage: -- command was aborted
 [ 197.621166] usb 1-1.1: reset high-speed USB device number 6 using ehci_hcd

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.