Re: xhci data toggle out of sync

From: Hans Petter Selasky <hps_at_selasky.org>
Date: Tue, 19 Apr 2022 09:50:39 UTC
On 4/19/22 11:20, Mahesh Vardhamanaiah wrote:
> Hi HPS,
> 
> Please find the requested logs.
> 
> xhci0: MMV endpoint 3 state 2
> xhci0: MMV Could not stop endpoint 3 err 12
> xhci0: MMV endpoint 3 state 3
> xhci0: MMV Could not stop endpoint 3 err 12
> xhci0: MMV Could not reset endpoint 3 err 12
> xhci0: MMV endpoint 3 state 2
> xhci0: MMV Could not stop endpoint 3 err 12
> xhci0: MMV endpoint 3 state 3
> xhci0: MMV Could not stop endpoint 3 err 12
> xhci0: MMV Could not reset endpoint 3 err 12
> 
> FreeBSD/arm (Amnesiac) (ttyu0)
> 
> login:
> WARNING: User disconnection from this port.
>           Current number of users: 2
> xhci0: MMV endpoint 3 state 2
> xhci0: MMV Could not stop endpoint 3 err 12
> xhci0: MMV endpoint 3 state 3
> xhci0: MMV Could not stop endpoint 3 err 12
> xhci0: MMV Could not reset endpoint 3 err 12
> 
> Thanks,
> Mahesh
> 

Hi Mahesh,

According to section 6.2.3 in the XHCI specification:

state 2 : Halted (SW shall issue a reset endpoint)
state 3 : stopped (The endpoint is not running)

err 12 : means USB_ERR_NO_PIPE,		/* 12 */

Which is not a valid return code from xhci_do_command(). Can you check 
where this value comes from?

BTW: I see a small bug in xhci_do_command(), that it doesn't wait if the 
command ring is full when entering the function.

--HPS