简体   繁体   English

为什么 dwc3 usb controller 没有报告 xfercomplete 事件? 或者小工具驱动程序错过了那个事件?

[英]why a dwc3 usb controller didnot report xfercomplete event? Or the gadget driver missed that event?

Android phone that use usb connect to a PC, open the rndis, then do iperf test between the phone and the PC.使用usb的Android手机连接PC,打开rndis,然后在手机和PC之间进行iperf测试。 After a few of hour's test, the endpoint of rndis, ep1out, didnot receive a xfercomplete event that the gadget driver should receve after sent transfer command.经过几个小时的测试,rndis 的端点 ep1out 没有收到小工具驱动程序在发送传输命令后应该收到的 xfercomplete 事件。

I try to enlarge event buffer size from 256 to 4096, also enlage the grxfifosize from delault value, but the issue remains.我尝试将事件缓冲区大小从 256 扩大到 4096,也将 grxfifosize 的值从 delault 中放大,但问题仍然存在。

The phone have 8 cortex-A53 core, but we leave 1 little core(cpu0) and 1 big core(cpu7) online, and set the dwc interrupt not routing to cpu0 by setting the smp_affinity of the dwc irq because of the throughput reason.手机有8个cortex-A53核心,但是我们留下1个小核心(cpu0)和1个大核心(cpu7)在线,由于吞吐量原因,通过设置dwc irq的smp_affinity设置dwc中断不路由到cpu0。 So the dwc3_interrupt runs at cpu7,and the dwc3_thread_interrupt also runs at cpu7.所以dwc3_interrupt在cpu7上运行,dwc3_thread_interrupt也在cpu7上运行。

Very strange that if we routing the irq to cpu0, and the dwc3_thread_interrupt runs at different core(cpu7), the issue disappear, canot understand why.很奇怪,如果我们将 irq 路由到 cpu0,并且 dwc3_thread_interrupt 在不同的 core(cpu7) 运行,问题就消失了,不明白为什么。

The code is open souce from the synopsys that you can find at kernel/drivers/usb/dwc3/gadget.c代码是来自 synopsys 的开源代码,您可以在 kernel/drivers/usb/dwc3/gadget.c 找到

https://github.com/aosp-mirror/kernel_msm/blob/e8adfc30ff9282a728fd8b666b6418308164c415/drivers/usb/dwc3/gadget.c https://github.com/aosp-mirror/kernel_msm/blob/e8adfc30ff9282a728fd8b666b6418308164c415/drivers/usb/dwc3/gadget.Z4A8A08F09D37B73795364

Thanks in advance.提前致谢。

Finally, found the answer, the event data in the eventbuffer was delayed behind the interrupt and the EVENTCOUNT register.终于找到了答案,eventbuffer中的事件数据在中断和EVENTCOUNT寄存器之后延迟了。 When the issue happened, the data in the eventbuffer was dirty of the last round.当问题发生时,事件缓冲区中的数据是上一轮的脏数据。 By many times of reading the data, got the right one.通过多次读取数据,得到了正确的数据。

So, it was not missing the xfercomplete, but delayed.因此,它并没有错过 xfercomplete,而是延迟了。 Don't know why the delay happened, the interrupt should be generated after the completes of the transferring.不知道为什么会发生延迟,应该是在传输完成后产生中断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM