USB3 hangs when connecting a UASP enabled portable drive

Hello,
can anybody give me some pointers why the USB3 (XHCI) is not working for me? The installation is an R32.1 based build (we did build our own kernel using defconfig, leaving the user-space at the stock Ubuntu flashed by Jetpack).

Once the portable drive is connected, the xhci is brought out of sleep, then the /dev/sda is detected, partition on it, and probably with ubuntu trying to mount the sda1 partition, the controller unexpectedly hangs.

Originally tried on Leopard Imaging carrier board, but then put the CVM back to the Jetson ITX devkit carrier and the issue persists. The drive is an Samsung SSD in an USB3-to-SATA enclosure, that is UAS enabled, if that makes any importance. The reason to use this in our application is that the SATA port on Tegra has no hotplug capability.

EDIT: different bridge without UASP uses an usb-storage driver which works. My issue is only uas driver related.

The dmesg is as follows:

[  111.334718] tegra-xusb 3530000.xhci: exiting ELPG
[  111.338216] tegra-xusb 3530000.xhci: Firmware timestamp: 2018-12-26 10:30:04 UTC, Version: 55.12 release
[  111.339247] tegra-xusb 3530000.xhci: exiting ELPG done
[  111.554476] usb 2-1: new SuperSpeed USB device number 2 using tegra-xusb
[  111.567207] usb 2-1: New USB device found, idVendor=152d, idProduct=1576
[  111.567212] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  111.567214] usb 2-1: Product: AXAGON USB to SATA adapter
[  111.567216] usb 2-1: Manufacturer: JMicron
[  111.567219] usb 2-1: SerialNumber: 98765432100C
[  111.574342] scsi host2: uas
[  111.576229] scsi 2:0:0:0: Direct-Access     Samsung  SSD 850 EVO 500G 8101 PQ: 0 ANSI: 6
[  112.480046] dhd_bus_init: enable 0x06, ready 0x02 (waited 3000023us)
[  112.480239] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[  112.480258] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[  112.480260] Enabling wake69
[  112.480316] dhd_prot_ioctl : bus is down. we have nothing to do
[  112.480322] dhd_check_hang: Event HANG send up due to  re=0 te=0 e=-1 s=0
[  112.480340] dhd_open : wl_android_wifi_on failed (-14)
[  112.480346] dhd_prot_ioctl : bus is down. we have nothing to do
[  112.480350] CFGP2P-ERROR) wl_cfgp2p_bss_isup :
[  112.480352] 'cfg bss -C 0' failed: -1
[  112.480353] CFGP2P-ERROR) wl_cfgp2p_bss_isup :
[  112.480355] NOTE: this ioctl error is normal when the BSS has not been created yet.
[  112.480358] wl_android_wifi_off in
[  112.480361] dhd_prot_ioctl : bus is down. we have nothing to do
[  112.480393] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[  112.480394] Disabling wake69
[  112.480469] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 61
[  112.483031] wifi_platform_set_power = 0
[  112.690107]  wl_cfg80211_hang :
[  112.690112] In : chip crash eventing
[  112.690696]

               Dongle Host Driver, version 1.201.82 (r)
               Compiled from
[  112.690705] wl_android_wifi_on in
[  112.690709] wifi_platform_set_power = 1
[  112.902013] vdd-1v8: voltage operation not allowed
[  112.906831] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  112.926212] vdd-1v8: voltage operation not allowed
[  112.931013] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  112.950025] vdd-1v8: voltage operation not allowed
[  112.954825] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  112.967178] vdd-1v8: voltage operation not allowed
[  112.971986] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  113.078885] vdd-1v8: voltage operation not allowed
[  113.083687] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  113.091231] vdd-1v8: voltage operation not allowed
[  113.096028] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  113.104144] vdd-1v8: voltage operation not allowed
[  113.108952] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  113.115630] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 61
[  113.116121] firmware path not found
[  113.116241] F1 signature read @0x18000000=0x17214354
[  113.120429] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[  113.121024] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[  114.787835] sd 2:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[  114.795335] sd 2:0:0:0: [sda] 4096-byte physical blocks
[  114.801403] sd 2:0:0:0: [sda] Write Protect is off
[  114.806219] sd 2:0:0:0: [sda] Mode Sense: 53 00 00 08
[  114.806640] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  114.819078]  sda: sda1
[  114.821139] sd 2:0:0:0: [sda] Attached SCSI disk
[  117.245029] sd 2:0:0:0: [sda] tag#3 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD IN
[  117.245036] sd 2:0:0:0: [sda] tag#3 CDB: opcode=0x28 28 00 3a 38 5d e8 00 00 18 00
[  117.245305] scsi host2: uas_eh_bus_reset_handler start
[  118.892550] tegra-xusb 3530000.xhci: controller firmware hang
[  118.898295] tegra-xusb 3530000.xhci: hcd_reinit is disabled or in progress
[  122.354013] tegra-xusb 3530000.xhci: xHCI host not responding to stop endpoint command.
[  122.362010] tegra-xusb 3530000.xhci: Assuming host is dying, halting host.
[  122.405667] tegra-xusb 3530000.xhci: Host not halted after 16000 microseconds.
[  122.412889] tegra-xusb 3530000.xhci: Non-responsive xHCI host is not halting.
[  122.420013] tegra-xusb 3530000.xhci: Completing active URBs anyway.
[  122.426278] usb 2-1: cmd cmplt err -2
[  122.429978] tegra-xusb 3530000.xhci: HC died; cleaning up
[  122.430021] usb 2-1: Disable of device-initiated U1 failed.
[  122.430045] usb 2-1: Disable of device-initiated U2 failed.
[  122.430048] usb 2-1: Could not disable xHCI U2 timeout, bus schedule bandwidth may be impacted.
[  122.455179] tegra-xusb 3530000.xhci: hcd_reinit is disabled or in progress
[  125.147036] dhd_bus_init: enable 0x06, ready 0x02 (waited 3000023us)
[  125.147240] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[  125.147259] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[  125.147261] Enabling wake69
[  125.147321] dhd_prot_ioctl : bus is down. we have nothing to do
[  125.147327] dhd_check_hang: Event HANG send up due to  re=0 te=0 e=-1 s=0
[  125.147343] dhd_open : wl_android_wifi_on failed (-14)
[  125.147350] dhd_prot_ioctl : bus is down. we have nothing to do
[  125.147355] CFGP2P-ERROR) wl_cfgp2p_bss_isup :
[  125.147356] 'cfg bss -C 0' failed: -1
[  125.147357] CFGP2P-ERROR) wl_cfgp2p_bss_isup :
[  125.147359] NOTE: this ioctl error is normal when the BSS has not been created yet.
[  125.147363] wl_android_wifi_off in
[  125.147366] dhd_prot_ioctl : bus is down. we have nothing to do
[  125.147403] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[  125.147404] Disabling wake69
[  125.147478] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 61
[  125.150028] wifi_platform_set_power = 0
[  135.028727]

               Dongle Host Driver, version 1.201.82 (r)
               Compiled from
[  135.028737] wl_android_wifi_on in
[  135.028742] wifi_platform_set_power = 1
[  135.237912] vdd-1v8: voltage operation not allowed
[  135.242732] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.263171] vdd-1v8: voltage operation not allowed
[  135.267979] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.287955] vdd-1v8: voltage operation not allowed
[  135.292761] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.305166] vdd-1v8: voltage operation not allowed
[  135.309970] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.415985] vdd-1v8: voltage operation not allowed
[  135.420793] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.428757] vdd-1v8: voltage operation not allowed
[  135.433565] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.442171] vdd-1v8: voltage operation not allowed
[  135.446971] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[  135.454126] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 61
[  135.454462] firmware path not found
[  135.454563] F1 signature read @0x18000000=0x17214354
[  135.459246] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[  135.459836] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000

danieel,

Just wondering… did you configure your ubuntu user account already?
I don’t know why those logs are still there while the timestamp is already 125 ~135.

Yes, I am logging into my “daniel” account in ubuntu that was created when asked on first installation of R32.1. There is some sort of automatic mount - as in USB2 mode, a window appears with the SSD contents, while in USB3 the above log applies and no window is shown. I am not using the SD slot nor wanting to use WiFi so I dont know what triggers those errors - my concern is just the SSD over USB3 (but the issues might relate of course).

Would you mind sharing the full dmesg with us?

I have reverted to the original NV binary kernel and DTB (hopefully correct ones - judging by the signatures/paths since my build system uses different ones). The attached screen is 4K60 over HDMI2. I’ve noticed that with stock kernel, the SD calibration nor wifi messages are not repeated (will look into that later), but the XHCI vs UASP issue persist.

The full dmesg till login over SSH (to get the dmesg) - attached file.

With USB2 cable: PASS

[   60.429703] tegra-xusb 3530000.xhci: exiting ELPG
[   60.434897] tegra-xusb 3530000.xhci: Firmware timestamp: 2018-12-26 10:30:04 UTC, Version: 55.12 release
[   60.436269] tegra-xusb 3530000.xhci: exiting ELPG done
[   60.664152] usb 1-2: new high-speed USB device number 2 using tegra-xusb
[   60.713971] usb 1-2: New USB device found, idVendor=152d, idProduct=1576
[   60.713991] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   60.714005] usb 1-2: Product: AXAGON USB to SATA adapter
[   60.714016] usb 1-2: Manufacturer: JMicron
[   60.714027] usb 1-2: SerialNumber: 98765432100C
[   60.717245] scsi host2: uas
[   60.720708] scsi 2:0:0:0: Direct-Access     Samsung  SSD 850 EVO 500G 8101 PQ: 0 ANSI: 6
[   63.942010] sd 2:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[   63.949689] sd 2:0:0:0: [sda] 4096-byte physical blocks
[   63.961387] sd 2:0:0:0: [sda] Write Protect is off
[   63.966219] sd 2:0:0:0: [sda] Mode Sense: 5f 00 00 08
[   63.966676] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   63.979057]  sda: sda1
[   63.981233] sd 2:0:0:0: [sda] Attached SCSI disk
[   64.493669] EXT4-fs (sda1): recovery complete
[   64.493683] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   83.759659] usb 1-2: USB disconnect, device number 2
[   83.762158] sd 2:0:0:0: [sda] Synchronizing SCSI cache
[   84.013278] sd 2:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[   84.197426] usb usb1: usb_suspend_both: status 0
[   84.197464] tegra-xusb 3530000.xhci: entering ELPG
[   84.201213] tegra-xusb 3530000.xhci: entering ELPG done

With USB3 cable: FAIL

[  109.681265] tegra-xusb 3530000.xhci: exiting ELPG
[  109.686253] tegra-xusb 3530000.xhci: Firmware timestamp: 2018-12-26 10:30:04 UTC, Version: 55.12 release
[  109.687436] tegra-xusb 3530000.xhci: exiting ELPG done
[  109.918644] usb 2-1: new SuperSpeed USB device number 2 using tegra-xusb
[  109.940019] usb 2-1: New USB device found, idVendor=152d, idProduct=1576
[  109.940040] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  109.940055] usb 2-1: Product: AXAGON USB to SATA adapter
[  109.940066] usb 2-1: Manufacturer: JMicron
[  109.940077] usb 2-1: SerialNumber: 98765432100C
[  109.949595] scsi host2: uas
[  109.950556] scsi 2:0:0:0: Direct-Access     Samsung  SSD 850 EVO 500G 8101 PQ: 0 ANSI: 6
[  113.359557] sd 2:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[  113.367067] sd 2:0:0:0: [sda] 4096-byte physical blocks
[  113.373133] sd 2:0:0:0: [sda] Write Protect is off
[  113.377952] sd 2:0:0:0: [sda] Mode Sense: 53 00 00 08
[  113.378373] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  113.390680]  sda: sda1
[  113.392879] sd 2:0:0:0: [sda] Attached SCSI disk
[  114.978206] sd 2:0:0:0: [sda] tag#3 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD IN 
[  114.978237] sd 2:0:0:0: [sda] tag#3 CDB: opcode=0x28 28 00 00 00 00 80 00 00 90 00
[  114.978728] scsi host2: uas_eh_bus_reset_handler start
[  116.626025] tegra-xusb 3530000.xhci: controller firmware hang
[  116.631832] tegra-xusb 3530000.xhci: hcd_reinit is disabled or in progress
[  120.150163] tegra-xusb 3530000.xhci: xHCI host not responding to stop endpoint command.
[  120.158215] tegra-xusb 3530000.xhci: Assuming host is dying, halting host.
[  120.208825] tegra-xusb 3530000.xhci: Host not halted after 16000 microseconds.
[  120.216084] tegra-xusb 3530000.xhci: Non-responsive xHCI host is not halting.
[  120.223233] tegra-xusb 3530000.xhci: Completing active URBs anyway.
[  120.229557] usb 2-1: cmd cmplt err -2
[  120.233418] tegra-xusb 3530000.xhci: HC died; cleaning up
[  120.233565] usb 2-1: Disable of device-initiated U1 failed.
[  120.233730] usb 2-1: Disable of device-initiated U2 failed.
[  120.233753] usb 2-1: Could not disable xHCI U2 timeout, bus schedule bandwidth may be impacted.
[  120.258775] tegra-xusb 3530000.xhci: hcd_reinit is disabled or in progress

dmesg-boot-till-login.txt (65.9 KB)

Hi daniell,

Could you add below patch? Please change the device ID for your own drive.

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 8b9866b..68ad850 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -235,6 +235,8 @@ static struct usb_device_id max_burst_quirk_list[] = {
        { USB_DEVICE_SS(0x0bc2, 0xab26) },
        /* Seagate Expansion Portable Drive 1TB */
        { USB_DEVICE_SS(0x0bc2, 0x231a) },
+       /* JMicron TEYADI External SSD */
+       { USB_DEVICE_SS(0x152d, 0x0576) },
        { }  /* terminating entry must be last */
 };

@WayneWWW thanks!

Adding my USB device ID (that is 152D:1567) to static struct usb_device_id max_burst_quirk_list array in drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c had solved this problem.

I’ve encountered the same problem with another device (JMicron USB to PCIE Bridge, idVendor=152d, idProduct=0583). I haven’t tried the suggested kernel patch yet, instead I disabled UAS for this device, which doesn’t require rebuilding the kernel. Just execute the following command before attaching the disk:

echo 152d:0583:u > /sys/module/usb_storage/parameters/quirks

(change 152d to USB vendor ID and 0583 to product ID)

Alternatively it can be done by adding usb_storage.quirks=152d:0583:u kernel boot parameter.