Re: [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers

From: Morgan Chang
Date: Mon Jan 09 2017 - 03:13:40 EST


Hi, John

On Thu, Feb 4, 2016 at 8:25 PM, Vahram Aharonyan
<Vahram.Aharonyan@xxxxxxxxxxxx> wrote:
> On 2/3/2016 3:40 PM, Robert Baldyga wrote:
>
> Hi Robert,
>
> DTXFSTS register is linked with endpoint, not FIFO - it contains information about how much space is used in the FIFO assigned to the endpoint. Changing ep->index to ep->fifo_index will work, if FIFO number assigned to that endpoint coincides with ep->index. For example, TX FIFO #1 has been assigned to EP 1 In. If TX FIFO #2 was assigned to EP #1, then with this change DTXFSTS[2] will be used instead of DTXFSTS[1] for EP #1.
>
> Thanks,
> Vahram.

As mentioned by Vahram, DTXFSTS registers are indexed by endpoint
number, instead of FIFO number.
It should be reverted.