genodelabs / genode

Genode OS Framework
https://genode.org/
Other
1.07k stars 254 forks source link

usb: Samsung Portable SSD T5 inaccessible in Sculpt Linux VM (SuperSpeedPlus device) #4598

Closed chelmuth closed 6 months ago

chelmuth commented 2 years ago

The device 04e8:61f5 seems to be initialized correctly when plugged except the following string descriptor errors in the host driver.

[init -> drivers -> usb_drv] Could not read string descriptor index: 0
[init -> drivers -> usb_drv] Could not read string descriptor index: 0
[init -> drivers -> usb_drv] Could not read string descriptor index: 0

The USB storage driver successfully reads the first blocks of the device and, thus, the partition table is parsed correctly. Subsequent usage in Inspect and e2fsck also worked.

Further, if the device is passed to a Linux VM in VirtualBox, the guest fails to initialize the device. This stems from the fact, that the device is USB_SPEED_SUPER_PLUS, which is currently not supported in the USB session and qemu-usb as well. Clamping the speed to USB_SPEED_SUPER in repos/dde_linux/src/lib/lx_emul/usb.c did not suffice to make it work but resulted in other errors.

[Wed Aug 31 15:27:42 2022] usb 3-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[Wed Aug 31 15:27:42 2022] usb 3-1: New USB device found, idVendor=04e8, idProduct=61f5, bcdDevice= 1.00
[Wed Aug 31 15:27:42 2022] usb 3-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[Wed Aug 31 15:27:42 2022] usb 3-1: Product: Portable SSD T5
[Wed Aug 31 15:27:42 2022] usb 3-1: Manufacturer: Samsung
[Wed Aug 31 15:27:42 2022] usb 3-1: SerialNumber: 12345689A0B8
[Wed Aug 31 15:27:42 2022] usbcore: registered new interface driver usb-storage
[Wed Aug 31 15:27:42 2022] scsi host4: uas
[Wed Aug 31 15:27:42 2022] usbcore: registered new interface driver uas
[Wed Aug 31 15:28:02 2022] scsi 4:0:0:0: tag#24 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN 
[Wed Aug 31 15:28:02 2022] scsi 4:0:0:0: tag#24 CDB: Inquiry 12 00 00 00 24 00
[Wed Aug 31 15:28:02 2022] scsi host4: uas_eh_device_reset_handler start
[Wed Aug 31 15:28:03 2022] usb 3-1: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[Wed Aug 31 15:28:03 2022] scsi host4: uas_eh_device_reset_handler success
[Wed Aug 31 15:28:03 2022] scsi 4:0:0:0: tag#24 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD 
[Wed Aug 31 15:28:03 2022] scsi 4:0:0:0: tag#24 CDB: Test Unit Ready 00 00 00 00 00 00
[Wed Aug 31 15:28:03 2022] scsi host4: uas_eh_device_reset_handler start
[Wed Aug 31 15:28:03 2022] usb 3-1: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[Wed Aug 31 15:28:03 2022] scsi host4: uas_eh_device_reset_handler success
[Wed Aug 31 15:28:03 2022] scsi 4:0:0:0: Device offlined - not ready after error recovery
chelmuth commented 1 year ago

Based on the findings in #5041, the following lines in the Linux log look suspicious and hint UAS may be the cause of this issue too.

[Wed Aug 31 15:27:42 2022] usbcore: registered new interface driver usb-storage
[Wed Aug 31 15:27:42 2022] scsi host4: uas
[Wed Aug 31 15:27:42 2022] usbcore: registered new interface driver uas
chelmuth commented 6 months ago

Let's close this issue as duplicate of the more generic "usb: USB passthrough breaks UAS #5041".