Closed smzahraee closed 5 years ago
What platform? Do you mean that rtw_os_recvbuf_resource_alloc() sometimes returns _FAIL? That means your system is running short of DMA coherent memory, and that usb_alloc_coherent() is failing.
I looked at other similar drivers, and they do not define CONFIG_USE_USB_BUFFER_ALLOC_RX. Perhaps it should be disabled by default.
i use this driver in sunxi a20 with kernel 3.4. i disabled CONFIG_USE_USB_BUFFER_ALLOC_RX and every thigs is fine now . but i don't know its side effects!!! is it possible to get ride of CPU stall by just unregistering driver and its allocations?
Once there is a CPU stall, then unloading the driver is unlikely to correct the stall. From what I see in the code, if the driver is unable to allocate DMA coherent memory, the driver does not make a proper recovery. Rather than trying to fix that situation, I will remove all usage of CONFIG_USE_USB_BUFFER_ALLOC_RX so that no one else falls into this trap. I do not think there are serious side effects. DMA with USB devices should work without needing coherent memory.
in driver initilization if i enabled
CONFIG_USE_USB_BUFFER_ALLOC_RX
the functionrtw_os_recvbuf_resource_alloc
seldom will return_FAIL
and finally we get cpu stall error message in kernel.