Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Thunderbolt 3 with USB-C drive
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
manwe_
l33t
l33t


Joined: 01 Feb 2006
Posts: 629
Location: Kraków/Cracow, Poland

PostPosted: Wed Jan 08, 2020 5:28 pm    Post subject: [SOLVED] Thunderbolt 3 with USB-C drive Reply with quote

Hi *.

My first laptop with TB3 (Toshiba X40-E). Alternate Mode (Display Port) is working fine, but I have a problem with standard USB-C hard drive. When connected to TB3 via USB-C 3.1Gen1 (5Gbps) cable, no block device shows up. Works completly fine when connected to type A port via USB 3.1Gen1 A»C cable. Also works with TB3 on Win10 so it's (probably) not BIOS/UEFI related.

I've done diff of whole /dev and /sys before and after connecting the drive. Content of /dev folder doesn't change, content of /sys gains this:
Code:
10918a10919
> /sys/class/typec/port0-partner
11616a11618,11629
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/uevent
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/accessory_mode
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/power
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/power/runtime_active_time
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/power/runtime_status
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/power/autosuspend_delay_ms
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/power/runtime_suspended_time
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/power/control
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/device
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/subsystem
> /sys/devices/platform/USBC000:00/typec/port0/port0-partner/supports_usb_power_delivery

So *something* is detected.

Any ideas? Kernel config: https://pastebin.com/raw/6gqNTSR4

-- update:
So far I found that CONFIG_USB_UAS was disabled and is required in this USB over TB3 combination. Unfortunately after enabling, nothing changed. So I'm missing at least one more thing.

-- update 2:
Another attempt, this time with CONFIG_HOTPLUG_PCI_PCIE (because TB3 passes PCIe). Still nothing. Also I've checked Ubuntu Live - works fine. So it's definitely something in my kernel.


Last edited by manwe_ on Thu Jan 23, 2020 12:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
manwe_
l33t
l33t


Joined: 01 Feb 2006
Posts: 629
Location: Kraków/Cracow, Poland

PostPosted: Tue Jan 14, 2020 9:41 am    Post subject: Reply with quote

Shameless bump :roll:
Back to top
View user's profile Send private message
nvaert1986
n00b
n00b


Joined: 05 May 2019
Posts: 56

PostPosted: Thu Jan 16, 2020 3:23 pm    Post subject: Reply with quote

I'm using USB Type-C devices just fine on my Thunderbolt ports and it works (have a J-Micron USB-C to NVME Mass Storage Controller, which I can confirm that works):

Make sure the following are set:
CONFIG_TYPEC
CONFIG_TYPEC_TCPM
CONFIG_TYPEC_TCPCI
CONFIG_TYPEC_UCSI
CONFIG_UCSI_ACPI <- Required for Skylake and upwards
CONFIG_TYPEC_DP_ALTMODE -< For DisplayPort
CONFIG_TYPEC_NVIDIA_ALTMODE <- For NVIDIA VirtualLink
CONFIG_USB_ROLE_SWITCH <- USB Role Switch Support

I assume the CONFIG_USB_XHCI_HCD and CONFIG_USB_PCI and CONFIG_USB_STORAGE are already set.
Back to top
View user's profile Send private message
nvaert1986
n00b
n00b


Joined: 05 May 2019
Posts: 56

PostPosted: Thu Jan 16, 2020 3:26 pm    Post subject: Reply with quote

I also suggest you set CONFIG_INTEL_WMI_THUNDERBOLT to Y

P.S.: If it's a recent laptop I'd also suggest running kernel-5.4

Update: My own .config file so you can compare: https://pastebin.com/D0BeSaVv
It's for kernel 5.4.12.
Back to top
View user's profile Send private message
manwe_
l33t
l33t


Joined: 01 Feb 2006
Posts: 629
Location: Kraków/Cracow, Poland

PostPosted: Wed Jan 22, 2020 6:08 pm    Post subject: Reply with quote

Yes. I have everything you mentioned (except CONFIG_TYPEC_NVIDIA_ALTMODE, but I don't have nVidia GPU). Still doesn't work with newest kernel (5.4.13). Current config: https://pastebin.com/BHamDhSj

When I connect any pendrive to TB3 port in Ubuntu, first thing in dmesg that appears is creating new USB hub/controller, then the device shows up. So, looks like to me, what doesn't work in my kernel is that fallback, from TB3 to USB-C XHCI.

-- update:

I've found another difference between Ubuntu and my kernel. Ubuntu's lspci shows
Code:
04:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:01.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:02.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:04.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport

My Gentoo doesn't show this. But so far I have no idea why.
Back to top
View user's profile Send private message
nvaert1986
n00b
n00b


Joined: 05 May 2019
Posts: 56

PostPosted: Wed Jan 22, 2020 8:09 pm    Post subject: Reply with quote

manwe_ wrote:
Yes. I have everything you mentioned (except CONFIG_TYPEC_NVIDIA_ALTMODE, but I don't have nVidia GPU). Still doesn't work with newest kernel (5.4.13). Current config: https://pastebin.com/BHamDhSj

When I connect any pendrive to TB3 port in Ubuntu, first thing in dmesg that appears is creating new USB hub/controller, then the device shows up. So, looks like to me, what doesn't work in my kernel is that fallback, from TB3 to USB-C XHCI.

-- update:

I've found another difference between Ubuntu and my kernel. Ubuntu's lspci shows
Code:
04:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:01.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:02.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport
05:04.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
   Kernel driver in use: pcieport

My Gentoo doesn't show this. But so far I have no idea why.


Normally thunderbolt should be in use in your configuration too. Same goes for ACPI hotplug and PCI-E hotplug and PCI-E support. Did you actually compile PCI-E support? Did you try a fresh compilation?
Back to top
View user's profile Send private message
manwe_
l33t
l33t


Joined: 01 Feb 2006
Posts: 629
Location: Kraków/Cracow, Poland

PostPosted: Wed Jan 22, 2020 8:36 pm    Post subject: Reply with quote

I've added CONFIG_HOTPLUG_PCI_ACPI to already enabled CONFIG_HOTPLUG_PCI_PCIE but it didn't help.

> Did you actually compile PCI-E support?

Everything else works, like NVMe drive.

> Did you try a fresh compilation?

You mean make mrproper? I did.
Back to top
View user's profile Send private message
manwe_
l33t
l33t


Joined: 01 Feb 2006
Posts: 629
Location: Kraków/Cracow, Poland

PostPosted: Thu Jan 23, 2020 12:48 pm    Post subject: Reply with quote

Finally! CONFIG_HOTPLUG_PCI_SHPC=y and now it works flawlessly. When I plug in USB-C storage, all JHL6540 TB3 Bridge devices show up in lspci.

But to be honest, SHPC description in kernel is shit. It says nothing about TB3, JHL6540 or Alpine Ridge. I found it thanks to this website. https://www.linux-hardware.org/index.php?id=pci:8086-15d3-2222-1111
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum