Page 2 of 2

Re: xHCI: Command Ring does not work on my laptop

Posted: Sat Dec 26, 2020 9:26 am
by rdos
I don't know if this is relevant or not, but I had an buffer error in my XHCI driver, and it resulted in the event ring stopping too. The USB status register indicated halted and controller error. That's the only scenario I've seen that results in commands on the command ring not resulting in activity on the primary event ring.

I also had problems with multiple MSI vectors. One of my XHCI controllers failed to send the IRQ when the second interrupter was used. I could pin-down this problem to the IRQ itself, because if I sent an IPI to the same vector then all the chains in the event ring happened as expected. I don't know if this is a bug in XHCI or how I setup MSI interrupts. Still, I do use multiple MSI interrupts with AHCI, and it seems to work there, so I don't know.

Re: xHCI: Command Ring does not work on my laptop

Posted: Mon Dec 28, 2020 8:33 pm
by tokusan
Progress report: I allocated the scratchpad buffers. Contexts are already proper sizes, either 32-bit or 64-bit. Now everything works on my laptop, including the initialization of xHC, ports, slots, and endpoints. Port Status Change TRB is issued after a new USB device is plugged.
Still, this OS cannot receive any TRBs on my desktop.

Re: xHCI: Command Ring does not work on my laptop

Posted: Tue Dec 29, 2020 5:23 am
by tokusan
I found that Haiku iterated over the xHCI capabilities to move the ownership of the xHC: https://github.com/haiku/haiku/blob/mas ... i.cpp#L293
I'll do the same and check if it is the cause.

Re: xHCI: Command Ring does not work on my laptop

Posted: Tue Dec 29, 2020 5:53 pm
by tokusan
tokusan wrote:I found that Haiku iterated over the xHCI capabilities to move the ownership of the xHC: https://github.com/haiku/haiku/blob/mas ... i.cpp#L293
I'll do the same and check if it is the cause.
Yes, it was the cause. I just misunderstood the spec. Now this OS can find the connected ports.

Thank you for taking your time, nullplan, rdos, and iman.