Skip to content

Instantly share code, notes, and snippets.

@hyphop
Created April 21, 2020 04:13
Show Gist options
  • Save hyphop/d971e4d745d67024e05b323f8d0de1f0 to your computer and use it in GitHub Desktop.
Save hyphop/d971e4d745d67024e05b323f8d0de1f0 to your computer and use it in GitHub Desktop.
mainline usb starage problem

PROBLEM

we can get any USB pcie nvm or msata adapter and check (uas module) and plug to USB3 socket need wait about 100s before we can get real access to block dev /dev/sda


root@Khadas:~# uname -a
Linux Khadas 5.5.0-rc2 #0.8.3 SMP PREEMPT Sun Apr 5 14:18:12 +09 2020 aarch64 aarch64 aarch64 GNU/Linux

root@Krescue:/# uname -a
Linux Krescue 5.4.5 #1 SMP PREEMPT Tue Apr 21 00:02:07 +09 2020 aarch64 GNU/Linux


root@Khadas:~# dmesg -c 
[   39.716638] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[   39.741351] usb 2-1: New USB device found, idVendor=152d, idProduct=0583, bcdDevice= 2.03
[   39.741359] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   39.741362] usb 2-1: Product: USB to PCIE Bridge
[   39.741365] usb 2-1: Manufacturer: JMicron
[   39.741368] usb 2-1: SerialNumber: 0123456789ABCDEF
[   39.751775] scsi host0: uas
[   39.752728] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0203 PQ: 0 ANSI: 6
[   39.753871] usbcore: registered new interface driver uas
..........
.......... LONG DELAY
..........
[   72.686288] sd 0:0:0:0: tag#29 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN 
[   72.686299] sd 0:0:0:0: tag#29 CDB: opcode=0x9e, sa=0x10 9e 10 00 00 00 00 00 00 00 00 00 00 00 20 00 00
[   72.702290] scsi host0: uas_eh_device_reset_handler start
[   72.830461] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[   72.851705] scsi host0: uas_eh_device_reset_handler success
[   72.858839] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[   72.858842] sd 0:0:0:0: [sda] 4096-byte physical blocks
[   72.858977] sd 0:0:0:0: [sda] Write Protect is off
[   72.858980] sd 0:0:0:0: [sda] Mode Sense: 5f 00 00 08
[   72.859237] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   72.859451] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
.......
....... DELAY
....... 
[   75.724654]  sda: sda1
[   75.725825] sd 0:0:0:0: [sda] Attached SCSI disk
.......
....... AGAIN FREEZE
.......
[  107.508601] sd 0:0:0:0: [sda] tag#28 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN 
[  107.508608] sd 0:0:0:0: [sda] tag#28 CDB: opcode=0x28 28 00 1d 1c 58 80 00 00 08 00
[  138.229245] sd 0:0:0:0: [sda] tag#29 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD IN 
[  138.229251] sd 0:0:0:0: [sda] tag#29 CDB: opcode=0x28 28 00 00 00 00 00 00 00 08 00
[  138.245236] scsi host0: uas_eh_device_reset_handler start
[  138.373399] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[  138.394590] scsi host0: uas_eh_device_reset_handler success
[  140.141858]  sda: sda1
.......
....... READY
.......
@hyphop
Copy link
Author

hyphop commented Apr 21, 2020

root@aml:~# uname -a

Linux aml 5.5.0-rc6-aml-s9xxx #rc1.037 SMP PREEMPT Wed Feb 5 16:55:20 MSK 2020 aarch64 GNU/Linux

[   65.374227] usb 2-1: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd
[   65.411245] usb 2-1: New USB device found, idVendor=152d, idProduct=0583, bcdDevice= 2.03
[   65.428403] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   65.444407] usb 2-1: Product: USB to PCIE Bridge
[   65.458886] usb 2-1: Manufacturer: JMicron
[   65.473242] usb 2-1: SerialNumber: 0123456789ABCDEF
[   65.492648] scsi host0: uas
[   65.508180] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0203 PQ: 0 ANSI: 6
[   65.527114] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   67.421705] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[   67.425145] sd 0:0:0:0: [sda] 4096-byte physical blocks
[   67.430454] sd 0:0:0:0: [sda] Write Protect is off
[   67.435062] sd 0:0:0:0: [sda] Mode Sense: 5f 00 00 08
[   67.435321] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   67.444238] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[   67.479424]  sda: sda1
[   67.482415] sd 0:0:0:0: [sda] Attached SCSI disk

@hyphop
Copy link
Author

hyphop commented Apr 21, 2020

LibreELEC:/ # uname -a
Linux LibreELEC 5.6.0-rc4 #1 SMP Mon Mar 16 10:13:42 CET 2020 aarch64 GNU/Linux

[   95.598652] usb 2-1: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd
[   95.619294] usb 2-1: New USB device found, idVendor=152d, idProduct=0583, bcdDevice= 2.03
[   95.619300] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   95.619303] usb 2-1: Product: USB to PCIE Bridge
[   95.619306] usb 2-1: Manufacturer: JMicron
[   95.619308] usb 2-1: SerialNumber: 0123456789ABCDEF
[   95.621686] scsi host0: uas
[   95.636032] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0203 PQ: 0 ANSI: 6
[   97.611956] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[   97.611961] sd 0:0:0:0: [sda] 4096-byte physical blocks
[   97.612755] sd 0:0:0:0: [sda] Write Protect is off
[   97.612760] sd 0:0:0:0: [sda] Mode Sense: 5f 00 00 08
[   97.613045] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   97.613301] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[   97.627920]  sda: sda1
[   97.629173] sd 0:0:0:0: [sda] Attached SCSI disk


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment