Sponsored by: Mellanox Technologies
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).
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.