
Most long-standing XHCI (USB 3.0+) issues resolved - protomyth
https://www.haiku-os.org/blog/waddlesplash/2019-03-08_most_long-standing_xhci_usb3_issues_resolved/
======
userbinator
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.

~~~
waddlesplash
(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
> 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
No, 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
There 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
We'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).

~~~
userbinator
Using a VM is another way --- a virtual USB controller can log how it's being
manipulated.

------
puppetmaster
Gentlepeople... the time to try Haiku is now! get an image, and boot it. Out
of 10 machines with different ages, all but one get to desktop in a few
seconds. For the one that gets to a blank screen equally fast, make sure to
press <space> on boot and choose vesa.

Browsers? Usable for the focused mind, lots of wip... For me, I have text
editors, compilers, a terminal, and aws cli... I can wish for more, but I am
happy with this.

~~~
tinco
Is it safe to boot on an expensive laptop like a MacBook? I remember when
Linux had missing drivers there were risks that you'd overheat your machine
because the laptop manufacturer was controlling a system fan in some
nonstandard way.

~~~
waddlesplash
Macbooks >= ~2013 or so will run into this kernel panic shortly after boot:
[https://dev.haiku-os.org/ticket/13189](https://dev.haiku-os.org/ticket/13189)

2012 and earlier Macbooks pretty much work, I'm told (though you will hit the
remaining NEC/Renesas bug I mentioned in the blog post, so use a USB2 drive
until we manage to debug that.)

But yes, generally our hardware support is not quite as good as Linux's, so
you will have a mixed bag in Macbooks. High-end PC laptops (e.g. Dell XPS 13)
are fine.

EDIT: According to the comment below, it seems I was misremembering, and these
problems occur on 2015-and-up Macbooks, not 2013-and-up.

~~~
smallstepforman
I run Haiku natively on MacBook Pro 2014 (11.3), on SSD with EFI boot. Have
working audio (headphones only), wired ethernet (no WiFi), very usable Hi-DPI
display (2880x1800) with basic framebuffer driver. Retina MBP up to 2015
should all work like mine. Good enough for developing apps.

------
ky738
Haiku is an amazing project. I just wished they had like a shop to purchase
t-shirts, stickers, plushies and whatnot like the FSF. I'd buy in an instant,
and it probably would be great for their donation goals.

~~~
waddlesplash
But we do!
[https://www.cafepress.com/haiku_os](https://www.cafepress.com/haiku_os)

~~~
ky738
That's awesome! But I wish it was more visible in the website, I couldn't find
it at first glance

------
benj111
So I guess Haiku development isn't going that well if they're struggling to
get USB 3 sorted.

Shame, it seemed a promising project.

Edit: Okay my assessment was based on this, the fact that there only seems to
be a beta release for download, and there didn't seem to be a decent web
browser at some point fairly recently ( there was a story on HN?). Are these
misunderstandings? Do we have different definitions of 'doing well'?

~~~
agildehaus
Responding to your edit: I downvoted you because your comment was not
constructive and basically was just chastising a project composed entirely of
a few geographically-separated volunteers.

It's very honestly amazing what they've accomplished.

~~~
benj111
Wasn't intended to chastise them at all.

Yes it is amazing what they've accomplished.

I was mourning the fact that despite all the mind share, all the talented
developers, they didn't manage to produce an OS that just works (tm). I'm
cognizant of the fact Linus Torvalds started out very in similar
circumstances. I don't know if it is Linux taking too much air out of the
room, or if in 2019, building the OS that just works (tm) is just too bigger
job for volunteers. That is the shame.

~~~
waddlesplash
> I was mourning the fact that despite all the mind share, all the talented
> developers, they didn't manage to produce an OS that just works (tm).

We have ~10-15 major active contributors, and with that, we can basically
compete with "Desktop Linux" in terms of functionality. Not everything works
or is polished to the degree we'd like ... but it's nearly there.

So then who is the one wasting the "mind share" \-- the Linux DE space, with
its hundreds of developers spread across dozens of projects, or us, who can do
basically the same thing with a fraction of the time and resources?

~~~
benj111
"basically compete with "Desktop Linux" in terms of functionality" On what
terms?

"Not everything works or is polished to the degree we'd like ... but it's
nearly there" What does nearly mean?

Please don't interpret those as being argumentative rhetorical questions, I
take the we to mean you're a contributor, so you have the right to define
those.

The first Alpha was in 2009? So personally I'd expect you to be there by now.
And I'd expect an OS that just works, which would include working USB 3, and a
decent web browser.

So when is a stable release due, (I would like to try it)?

What are your aims for the OS? Do you want an OS that I can recommend grandma
puts on her computer knowing it will work, or is it an OS where I'll have fun
diving into config files? Reading the website etc I've understood the longterm
aim to be the former. If I'm wrong please let me know, so I can calibrate my
expectations.

Thanks for your reply btw. I do want you to succeed.

~~~
waddlesplash
> "basically compete with "Desktop Linux" in terms of functionality" On what
> terms?

Err ... I don't know what you mean?

> "Not everything works or is polished to the degree we'd like ... but it's
> nearly there" What does nearly mean?

Uh, it means there are still a lot of bugs, and some missing major/minor
features in certain areas (e.g. GPU acceleration is a massive TODO / WIP; I
have some work on it out-of-tree but it's not in yet.)

> The first Alpha was in 2009? So personally I'd expect you to be there by
> now.

Uh, excuse me? By whose standards? We are, as I said, 10-15 (well, then it was
a little more) people who do this for fun. We have lives outside of open
source development, you know. We aren't paid to do this.

> And I'd expect an OS that just works, which would include working USB 3, and
> a decent web browser.

So you expect a product. Great. Who's paying?

> So when is a stable release due, (I would like to try it)?

What's stopping you from trying it right now...?

> Do you want an OS that I can recommend grandma puts on her computer knowing
> it will work, or is it an OS where I'll have fun diving into config files?
> Reading the website etc I've understood the longterm aim to be the former.

That is correct.

~~~
benj111
Ok, so the long term aim is an OS I can put on Grandmas computer?

Ok, then I don't think it's fair to start being hostile to people when they
expect USB 3 support and a web browser. _I_ don't expect a product, that's
what you're saying you're offering.

You said you're nearly there, I think it's reasonable to ask when that might
be. I'm not asking for a cast iron guarantee to the day, but 1 year? 5 years?
The thing stopping me from trying it is lack of stable release.

" "basically compete with "Desktop Linux" in terms of functionality" On what
terms?"

I mean do you want to be judged as a hobby OS, or something to stand toe to
toe with Linux on every measure. Theres no point me complaining USB 3 doesn't
work if your only aim for the project is something to do on an evening. You've
indicated that you want it to be something to put on Grandmas computer. Fine,
but that sets a much higher bar, and you can't say "fiddle with config file"
when something goes wrong.

Ps I'm still detecting hostility, I hope its because you vehemently believe
I'm wrong and you can succeed (I hope I'm wrong, and you do succeed)

~~~
zapzupnz
Self-entitlement, thy name is benj111 apparently. Nobody needs to measure
themselves against your lofty standards for them; they know what they're
doing.

If you want them to succeed, help them, get involved, don't sit on the
sidelines jeering at them for ten to fifteen people not being at the same
level as thousands of contributors.

~~~
benj111
Why am I self entitled? I'm not measuring them against _my_ lofty standards,
I'm measuring them against _their_ standards.

If they want to put it on github, with an announcement saying they've done a
thing for fun, what do you think? I'll judge it on those terms. If they say
they're aiming to create an OS that I can put on my Grandma's computer (which
they have, read the thread), then its only fair _on them_ to judge it in those
terms.

I've been complementary and wished them well several times in this thread,
because yes there are only 15 of them, but that doesn't change the fact, that
they haven't yet built what they said they were going to build. That isn't
jeering, and it isn't patting them on the head and telling them that it's the
taking part matters, either.

