Skip to content

Draft: Fixed the deadlock by only addressing devices in response to attach requests....

Problem:

The USB specification for device initialization was not implemented properly.

You are supposed to wait for a Port Status Event, verify that it represents an attach, and then send a slot enable command and address the device.

In our case, we werent waiting for that event, and so we had a race condition between the device being ready to receive an address, and our actual address command.

Solution:

I removed the "probe" function and created a device enumerator whose entire purpose is to handle device enumeration. When the irq reactor processes an event TRB, if the event TRB is a port status change event, it throws it on a queue for the enumerator to handle. The enumerator then attaches or detaches the device by enabling the slot and addressing the device, or disabling the slot and clearing the port state.

Drawbacks: [if any, describe the drawbacks of this pull request.]

TODOs: [what is not done yet.]

  • I cant figure out how to safely kill the child driver.

Fixes: The inconsistent behavior of the device probe functionality.

State: WIP, but it was requested that I submit this PR

Merge request reports