lwfinger / rtl8723bu

Driver for RTL8723BU
285 stars 145 forks source link

cpu stall when enabled CONFIG_USE_USB_BUFFER_ALLOC_RX #121

Closed smzahraee closed 5 years ago

smzahraee commented 5 years ago

in driver initilization if i enabled CONFIG_USE_USB_BUFFER_ALLOC_RX the function rtw_os_recvbuf_resource_alloc seldom will return _FAIL and finally we get cpu stall error message in kernel.

lwfinger commented 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.

smzahraee commented 5 years ago

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?

lwfinger commented 5 years ago

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.