Re: usb: dwc2: usb data transmitted to incorrect usb endpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maynard,

On 1/31/2019 3:36 AM, Maynard Cabiente wrote:
> Hi Minas,
> 
> On Wed, Jan 30, 2019 at 9:02 AM Minas Harutyunyan
> <minas.harutyunyan@xxxxxxxxxxxx> wrote:
>> Root cause of data messing between IN EP's because all IN EP's use same
>> TXFIFO. TxFIFO number 7. See DIEPCTL's, bits 22-25 txfnum, from debug logs:
>>
>> EP1IN DIEPCTL = 0x11ca8200
>> EP2IN DIEPCTL = 0x11ca8200
>> EP5IN DIEPCTL = 0x11ce8008
>>
>> Please apply below temporary patch for testing, in
>> dwc2_hsotg_ep_enable() function add follow row to reset previous value
>> of TxFIFO num:
>>
>> @@ -4005,6 +4016,7 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
>>                           ret = -ENOMEM;
>>                           goto error1;
>>                   }
>> +               epctrl &= ~(DXEPCTL_TXFNUM_LIMIT << DXEPCTL_TXFNUM_SHIFT);
>>                   hsotg->fifo_map |= 1 << fifo_index;
>>                   epctrl |= DXEPCTL_TXFNUM(fifo_index);
>>                   hs_ep->fifo_index = fifo_index;
>>
> 
> Wow! That actually fixes the issue. That's awesome that you found the
> culprit. Many thanks!
> 
Thank you for good news!

> I'm assuming that since you mentioned temporary patch that this is not
> the final patch that we should use. Is this assumption right?
> 
Temporary - I mean just for testing by you until submitting to mainline. 
Nothing else should be updated.
I submitted this patch "[PATCH] usb: dwc2: Fix EP TxFIFO number 
setting". Could you please add your "Tested-by" tag.

Thanks,
Minas


>> One more note.
>> We have one patch after 4.14.44:
>> "usb: dwc2: Fix TxFIFOn sizes and total TxFIFO size issues"
>> commit ID 9273083a1530891360e9fe4fad26ae96810db499
>>
>> This patch fixes issue with TxFIFO allocations. Actually, based on your
>> setup regdump, TxFIFO's allocations are NOT wrong (DPTXFSIZN(1-15)) even
>> without mentioned patch, but issue can popup in some scenarios.
>> Any case I suggest you apply above patch.
>>
> 
> Thanks for pointing this patch. I have applied it on our code base and
> it does not seem to have adverse effect on our system. So,  we'll keep
> it then as per your suggestion.
> 
> Regards,
> Maynard
> 





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux