Gentoo Archives: gentoo-user

From: Jack <ostroffjh@×××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: new USB question
Date: Tue, 06 Oct 2020 20:47:46
Message-Id: OIYKG56T.RSSWDW3V.TDGPNYUC@LKDQLWR3.X2EO6PQH.THDS5SQR
In Reply to: Re: [gentoo-user] Re: new USB question by Sid Spry
1 Bottom line - as far as I can tell, the motherboard and software are
2 actually all behaving correctly, if confusingly. Details below.
3
4 On 2020.10.06 00:45, Sid Spry wrote:
5 > On Mon, Oct 5, 2020, at 1:33 PM, Jack wrote:
6 > > Grant - thanks for the info.
7 > >
8 >> I'm curious about the pairing by PCI device - it's not clear if the
9 >> every root_hub is a real controller, or not. The specs of the board
10 >> say USB2: two ports on the back and two USB2 headers (so I don't
11 >> know why it claims 10 ports instead of 6) and USB3: three type A and
12 >> one Type C ports on the back. Bus 2 is a bit of a mystery, as
13 >> although the B350 chipset presumably does have an enhanced
14 >> superspeed (3.1) controller, it is not available through the
15 >> motherboard. If bus 3 is the unavailable 3.1 controller, then is
16 >> bus 1 driven by the CPU or the chipset, and where is the other one?
17 >> So far, anything plugged into any of the front ports or rear USB2
18 >> ports shows up on bus 1, and anything plugged into the rear USB3
19 >> ports shows up on bus 3. I think my new USB flash drive is really
20 >> USB2 and not USB3 as advertised.
21 >
22 > Logically I think the controllers are separate, but they are spawned
23 > from the same device. On an ARM64 system there is a single DWC3
24 > device per USB3/2 pair. Intel is moving to DesignWare's IP, and I
25 > think existing platforms that split devices are similar. Additionally
26 > the xHCI driver is now being used to drive all USB bus types.
27 Agreed. Under Linux, a single USB2/3 port shows up as two separate
28 ports, under separate hubs, but both mapped to the same controller.
29 Plug in a device, and it shows up on the hub for the speed of the
30 device. (We may have a terminology issue, but I'm calling the
31 controller the physical implementation in the CPU or chipset, and the
32 hub a more logical thing more based in the driver software.
33 >
34 > If you want to test this you can unbind the driver from individual
35 > PCIe devices. Check /sys/bus/pci/devices and see what disappears.
36 >
37 > On a development board I see:
38 >
39 > $ lsusb -t
40 > /: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
41 > /: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
42 > /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
43 > /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
44 > /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p,
45 > 480M
46 > /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p,
47 > 480M
48 >
49 > And I happen to know the first 2 lines are the platform device at
50 > fe900000. If I disable that device both disappear.
51 >
52 > However, as I tried to describe earlier, on most x86 systems I have
53 > used it is possible to actually plug a USB2 device into a port
54 > associated with a USB3 root hub and the output would be rewritten as
55 > such:
56 >
57 > $ lsusb -t
58 > /: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
59 > /: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
60 Here, my current understanding is not that bus 6 will be rewritten to
61 show the slower speed, but that a true USB3 device plugged into that
62 port will show up on bus 6, and a USB2 device plugged into the same
63 port will show up on bus 5.
64 >
65 > When all USB2 devices are removed the bus speed returns to 5000M.
66 I"m still guessing slightly, still not having a true USB 3.0 device to
67 test, but in my case, I don't think any hubs will switch speed. Two
68 hub/ports show up for each physical port.
69 >
70 > I suspect you are encountering some variation of this. Can you unplug
71 > absolutely everything and see the speeds reported by lsusb -t? Then,
72 > plug things in and see if they change. If you've already done this my
73 > apologies, it's kind of hard to find the text among all the dmesg.
74 No lines in libusb or libusb -t output change, only lines get
75 added/removed when plugging/unplugging anything. As I said, however,
76 my biggest problem now is that I don't actually have a real USB 3.0
77 device. The USB 3.0 flash drive I bought was simply a fraudulent
78 listing (already refunded) and the webcam seems to be internally
79 capable of SuperSpeed, but will never actually do so, since it's plug
80 is an old USB2 Type A plug, without the five extra connectors which
81 would carry the USB3 signale.
82 >
83 >> Later, I'll reboot into Windows to see what that shows, as MSI tech
84 >> support refuses to talk about Linux.
85 As much as I hate to have done so, running Microsoft's USB Viewer
86 finally made things click for me. That shows only two controllers,
87 both xHCI, and the IDs let me map them to what I see in Linux. One has
88 eight ports. Four of those ports are USB 3.0 only and the other four
89 are USB 1.1/2.0 - and they are listed as pairs of "companion ports."
90 On linux, each set of four shows up as a separate hub. These map to
91 the two USB3 headers, one of which is currently connected to the front
92 USB ports. All that comes from the CPU. the other controller shows
93 fourteen ports. The first eight are four pairs as with the other
94 controller. These are for the USB3 ports on the IP panel. (One of
95 these is Type_C, three are Type-A.) The remaining six ports are all
96 USB2 only, and are for the two USB2 ports on the back IO panel, and the
97 two USB2 headers on the motherboard. In linux, one bus shows the four
98 USB3 ports, and the other bus shows the four paired ports, plus the six
99 USB2 only ports/headers. Now that I understand it, it does make
100 sense. It just took an inordinate amount of work to figure it all out.
101 >
102 > It may be worth pointing out the platform implements standards that
103 > are divorced from the OS you are running. If it doesn't work with
104 > both it can still be their problem.
105 It apparently does work correctly with both OS's, but each OS handles
106 the naming/grouping of ports differently. I think it would also have
107 been clearer to me earlier if I did have a real USB3 device to use.
108 Actually, I'm still not quite sure why dmesg/lsusb shows the CPU based
109 controller as 10000M speed instead of the expected 5000M, but as long
110 as it works at 5000M it is doing what it claims it will do.
111 >
112 > Recently I had to do a differential test using Windows, assuming it'd
113 > be more featureful. It is. But Windows has issues with device
114 > enumeration. I am wondering if the original link speed problems (USB2
115 > devices slowing down USB3 busses) was a Linux-specific issue, or if
116 > it was just only visible to me on Linux.
117 I suspect to be absolutely sure about speeds, you would need to
118 actually test them. I've figured out how to test a flash drive with dd
119 on linux, but I'm not sure what the closest equivalent would be on
120 Windows. I'd guess you would need to test a USB3 device, both with and
121 without a USB2 device plugged into another port on the same bus.
122 >
123 > I think I am encountering some variation of your problem, but mine is
124 > even weirder. I have control over the device which is USB-C. In one
125 > cable orientation it will enumerate with Windows, in the other it
126 > will not. In that same orientation it will enumerate against an ARM64
127 > system as USB3. In the other orientation it will enumerate against
128 > ARM64/x86 systems as USB2. It seems to be unable to enumerate as a
129 > USB3 device on Linux, but I need to do more testing.
130 I have no experience at all wtih Type-C cables, but I'd read up, as I
131 recall reading that not all Type-C cables are equivalent, and I can
132 imagine that if the cable it not really wired completely and correctly,
133 it could lead to that symptom.
134 >
135 > A friend of mine reports he has a USB-C cable that is not reversible.
136 > This may not be the cable's fault.
137 Then again, it might be.
138 >
139 > So: Check your cable, and try more than one device. Also there may be
140 > bugs in either the kernel's xhci drivers or new USB3 hardware.
141 In my case, no cables involved, other than those which are part of the
142 device, and as I said, my two supposed USB3 devices are both USB2 only.
143
144 I'd say "sorry for the noise" but I know I've learned some stuff from
145 all this.
146
147 Jack