5 ms·
As of this writing, the XHCI spec is an 8MB PDF containing 604 pages. In contrast EHCI is 155 pages and OHCI and UHCI 160 and 47(!) pages, respectively. There's
by userbinator 8y ago
As of this writing, the XHCI spec is an 8MB PDF containing 604 pages. In contrast EHCI is 155 pages and OHCI and UHCI 160 and 47(!) pages, respectively. There's a lot of complexity in USB3, so it's not surprising it took this long to get the bugs out. The fact that "real" debugging requires an extremely expensive protocol analyser/oscilloscope also adds to that; without, you're basically restricted to "guess and test" and reverse-engineering other drivers to see the differences in behaviour.
- dmitrygr 8y agoYou should see the Bluetooth spec 4kilopages, before you even get to actual profiles.
- MrBuddyCasino 8y agoTo be fair, they've realized BT was all a huge unfixable clusterfuck and started anew in the later versions. I've heard that USB is worse though, especially AUSB-Audio, -PD and -Video.
- dmitrygr 8y ago> and started anew in the later versions. entirely not true source: been working on this for any many years :(
- MrBuddyCasino 8y agoI've only heard that 2nd hand, so forgive me for spreading bullshit. The current situation is that we have Bluetooth Classic, high speed (used for AirDrop?) and BLE, right? I guess the confusion was caused by the "BT classic" terminology, which if I understand you correctly means is here to stay?
- dmitrygr 8y agoclassic is here to stay because car kits LE uses a lot of the same HCI commands and some of the same protocols (l2cap). airdrop uses LE to establish connection
- waddlesplash 8y ago(I'm the author of the blogpost.) > without, you're basically restricted to "guess and test" and reverse-engineering other drivers to see the differences in behaviour. Not entirely. If you look at the commits I linked in the post, you'll see that most of them fixed rather egregious spec violations. Arguably the spec could have been clearer; but still. > The fact that "real" debugging requires an extremely expensive protocol analyser/oscilloscope also adds to that USB packets can be sniffed in Wireshark. But for the kinds of bugs that this driver had, that isn't helpful; most of the problems were failure to initialize the controller or sending invalid command sequences. So that wouldn't be very helpful anyway.
- monocasa 8y ago> or sending invalid command sequences Most of the protocol analyzers I've seen go out of their way to highlight invalid sequences and spec violations. IMO, that's most of their benefit.
- waddlesplash 8y agoNo, I mean we were sending invalid command sequences to the XHCI controller, and as a result it wasn't sending anything to the ports at all.
- nitrogen 8y agoThere are probably ways of dumping PCI writes; I'm curious if any tracing of that sort was used (comparing traces to known working OSes), or if it was all about comparing code to the spec.
- jclulow 8y agoWe've gone through similar rounds of debugging our XHCI bits on illumos. PCI and USB sniffing hardware is expensive and we have access to neither. You can get a long way by becoming comfortable with the specification, reading and getting review on your source, and by using the debugging tools on your OS (we have MDB and DTrace, etc).
- ken 8y agoThat's not quite fair. They're not even printed on the same size page! XHCI has much bigger margins. Compared to EHCI, it's 4 times as many pages, but only 3 times as many words. Plus, adding diagrams can help clarify, rather than adding complexity. And XHCI now has a glossary! Anyway, is that a lot for a technical specification? Most programming languages I've used in the past year have had longer specs than that (if they have one at all). Even plain C is over 500 pages now. The biggest concern I have here is requiring an oscilloscope. Nothing here looks like it should require an actual physical layer. Why was USB designed to conflate these layers in the first place? The whole OSI stack might be silly but separating the physical layer has always been a great idea. When I upgrade from 10/100 ethernet to 10/100/1000 ethernet, I don't have to re-test my web server and mail server.
- waddlesplash 8y ago> The whole OSI stack might be silly but separating the physical layer has always been a great idea. When I upgrade from 10/100 ethernet to 10/100/1000 ethernet, I don't have to re-test my web server and mail server. No, but you had to change all your network cards on both ends of the connection, and of course there were new drivers for the new chipsets. Same with USB.
- makomk 8y agoAlso, a lot of the XHCI hardware is itself buggy. Linux has so many workarounds for different issues with XHCI host controllers that they had to increase the flags variable indicating which needed to be enabled to 64 bits because they'd run out of bits: https://patchwork.kernel.org/patch/10421969/ https://patchwork.kernel.org/patch/10421969/