On Fri, 29 Jul 2005, jinzhcheng wrote: > This is log when i using host usb storage debug, > but i don't know what it is mean, and what's wrong with my device > driver.
I'll explain the log. We can skip most of it because at first everything worked normally. (By the way, you'll learn more if you compare this log to the g_file_storage debugging log on the peripheral.) > usb-storage: queuecommand called > usb-storage: *** thread awakened. > usb-storage: Command READ_10 (10 bytes) > usb-storage: 28 00 00 00 00 18 00 00 08 00 > usb-storage: Bulk Command S 0x43425355 T 0x9 L 4096 F 128 Trg 0 LUN 0 CL > 10 Here the host wants to read 8 sectors starting at sector 0x18, perhaps because it believes these sectors contain part of the partition table. > 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: usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries > usb-storage: Status code 0; transferred 4096/4096 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > 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 S 0x53425355 T 0x9 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > usb-storage: *** thread sleeping. The read succeeded. > unknown partition table > Attached scsi disk sda at scsi1, channel 0, id 0, lun 0 > usb-storage: queuecommand called > usb-storage: *** thread awakened. > usb-storage: Bad LUN (0:1) > usb-storage: scsi cmd done, result=0x40000 > usb-storage: *** thread sleeping. ... These are normal warning messages (the host is trying to access LUNs that don't exist). The next thing to happen was this. Was this when you ran "fdisk -l /dev/sda"? > usb-storage: device scan complete > usb-storage: queuecommand called > usb-storage: *** thread awakened. > usb-storage: Command READ_10 (10 bytes) > usb-storage: 28 00 00 00 00 00 00 00 40 00 > usb-storage: Bulk Command S 0x43425355 T 0x12 L 32768 F 128 Trg 0 LUN 0 > CL 10 Here the host tries to read 0x40 sectors starting at sector 0. > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: command_abort called > usb-storage: usb_stor_stop_transport called > usb-storage: -- cancelling URB > usb-storage: Status code -104; transferred 0/31 The host tried to send the CBW but the device did not acknowledge it. After a few seconds the host timed out and cancelled the command. Looking at the device log for this event might help explain what happened. > usb-storage: -- transfer cancelled > usb-storage: Bulk command transfer result=4 > usb-storage: -- command was aborted > usb-storage: usb_stor_Bulk_reset called > usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 > len=0 > usb-storage: Soft reset: clearing bulk-in endpoint halt > usb-storage: usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=82 > len=0 > usb-storage: usb_stor_clear_halt: result = 0 > usb-storage: Soft reset: clearing bulk-out endpoint halt > usb-storage: usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=01 > len=0 > usb-storage: usb_stor_clear_halt: result = 0 > usb-storage: Soft reset done > usb-storage: scsi command aborted > usb-storage: *** thread sleeping. The host sent the Bulk-only reset request and Clear-Halt requests for the two bulk endpoints. The reset appeared to succeed. > 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 0x12 L 0 F 0 Trg 0 LUN 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 S 0x53425355 T 0x12 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > usb-storage: *** thread sleeping. The host sent TEST UNIT READY to make sure the device finished performing the reset. It succeeded. > usb-storage: queuecommand called > usb-storage: *** thread awakened. > usb-storage: Command READ_10 (10 bytes) > usb-storage: 28 00 00 00 00 00 00 00 40 00 > usb-storage: Bulk Command S 0x43425355 T 0x13 L 32768 F 128 Trg 0 LUN 0 > CL 10 > 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: usb_stor_bulk_transfer_sglist: xfer 32768 bytes, 1 entries > usb-storage: Status code 0; transferred 32768/32768 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > 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 S 0x53425355 T 0x13 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > usb-storage: *** thread sleeping. The host retried the READ command for 0x40 sectors starting at sector 0. This time is worked, as did all the remaining READ commands in your log. Alan Stern ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
