Page MenuHomeFreeBSD

Check XHCI endpoint state before issuing XHCI endpoint commands
ClosedPublic

Authored by hselasky on Aug 14 2020, 10:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 9:56 AM
Unknown Object (File)
Dec 22 2023, 11:29 PM
Unknown Object (File)
Dec 21 2023, 7:54 PM
Unknown Object (File)
Nov 18 2023, 1:41 AM
Unknown Object (File)
Oct 14 2023, 8:09 PM
Unknown Object (File)
Aug 29 2023, 4:37 AM
Unknown Object (File)
Jun 18 2023, 6:35 PM
Unknown Object (File)
Dec 15 2022, 10:01 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz added a subscriber: bz.
bz added inline comments.
sys/dev/usb/controller/xhci.c
3826 ↗(On Diff #75817)

I assume it's fairly save to assume epno >= 1 here?

This revision is now accepted and ready to land.Aug 14 2020, 10:13 AM
sys/dev/usb/controller/xhci.c
3866 ↗(On Diff #75817)

@bz : A value of zero is checked here.

pstef added inline comments.
sys/dev/usb/controller/xhci.c
3826 ↗(On Diff #75817)

Since it's checked somewhere else, maybe it'd be a good idea to put here an assertion?

This revision now requires review to proceed.Aug 14 2020, 10:47 AM
This revision is now accepted and ready to land.Aug 14 2020, 2:27 PM

For what it's worth this doesn't fix the issues I'm seeing with a Corigine xHCI controller.
I wonder if it's worth adding explicit cases for ERROR (do nothing) and DISABLED (do nothing).

@kp: Feel free to comander this patch.

While not the fix for my problem I do believe this patch is correct, and aligns us better to the xHCI Endpoint State Diagram (xhci v1.1, 4.8.3 Endpoint Context State).

I believe my problem is that the state transitions for EP0 are different. Other OSs (Linux, NetBSD) simply skip the entire stop/set tr dequeue /... configure dance for EP0. This patch tries to do that for us: https://pastebin.com/hudthnUZ and does fix the issues I see with Corigine xHCI.