[Bug?] Control Transfers in xHCI

Hans Petter Selasky hps at selasky.org
Thu Jan 29 15:03:23 UTC 2015


On 01/29/15 13:25, Kohji Okuno wrote:
> Hi HPS,
>
> I found a bug in xHCI device driver.
>
> Acording to extensible-host-controler-interface-usb-xhci.pdf:"3.2.9
> Control Transfers"...
>
> A Data Stage TD consists of a Data Stage TRB followed by zero or more
> Normal TRBs. If the data is not physically contiguous, Normal TRBs may
> be chained to the Data Stage TRB.
>
>
> But, in the current imprementation, when two or more TRBs are needed,
> the device driver set XHCI_TRB_TYPE_DATA_STAGE to all TRBs.
> This is the violation of the spec.
>
> In my minor xHCI, I encountered strange bubble error in a control
> transfer. After I changed as the following, I succeeded its control
> transfer.
>
> Would you check the following (****)?
>

Hi Kohji,

You are correct there is a bug, but your patch is not correct.

In FreeBSD we allow SETUP and DATA stages to be done as separate jobs. 
That means at the entry of creating a new DATA chain, we need to check 
if it is there first DATA packet or not.

Can you test the attached patch and see if it works for you?

Thank you!

--HPS




More information about the freebsd-usb mailing list