WiFi AP with rtl8192cu: works with USB hub, but not directly

I have a USB WiFi module based on RTL8192CU.

When using an AP mode with kernels 4.14.x the module is configured and working properly only if connected via a USB hub.
With direct USB connection everything looks good, but stations cannot connect to the AP.
The only difference in the kernel messages is the last line “hwsec_cam_bitmap: 0x0 entry_idx=4” which appears when using a USB hub:


usb 1-1: New USB device found, idVendor=0bda, idProduct=817b
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 802.11n WLAN Adapter
usb 1-1: Manufacturer: Realtek
usb 1-1: SerialNumber: 00e04c000001
rtl8192cu: Chip version 0x11
rtl8192cu: Board Type 0
rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
ieee80211 phy0: Selected rate control algorithm ‘rtl_rc’
usbcore: registered new interface driver rtl8192cu
rtl8192cu 1-1:1.0 wlx0034f1812a4c: renamed from wlan0
rtl8192cu: MAC auto ON okay!
rtl8192cu: Tx queue select: 0x05
rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4 <==========

With kernels 4.9.x everything works properly. That extra message (mentioned above) doesn’t appear at all.
It’s not a current consumption issue as well: the device consumes only 120mA.

Thanks for advises and directions.
-Sergey

Is this one of those really small modules, do you have a part number/Amazon link I can take a look at it?

Regards,

Excerpts from Robert Nelson's message from Fri 22-Jun-18 12:52:

Yeah, those should be safe from the HDMI noise, that usually affects models with that chipset.

What’s the full uname -r of the last v4.14.x based kernel you tried?

Regards,

I built it yesterday‎ using your building scripts, it’s 4.14.51-bone15.



From: Robert Nelson
Sent: Friday, June 22, 2018 12:10
To: Sergey Manucharian
Cc: Beagle Board
Subject: Re: [beagleboard] WiFi AP with rtl8192cu: works with USB hub, but not directly

Excerpts from Robert Nelson’s message from Fri 22-Jun-18 12:52:

I have a USB WiFi module based on RTL8192CU.

When using an AP mode with kernels 4.14.x the module is configured and
working properly only if connected via a USB hub.
With direct USB connection everything looks good, but stations cannot
connect to the AP.
The only difference in the kernel messages is the last line “hwsec_cam_bitmap:
0x0 entry_idx=4” which appears when using a USB hub:


usb 1-1: New USB device found, idVendor=0bda, idProduct=817b
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 802.11n WLAN Adapter
usb 1-1: Manufacturer: Realtek
usb 1-1: SerialNumber: 00e04c000001
rtl8192cu: Chip version 0x11
rtl8192cu: Board Type 0
rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
ieee80211 phy0: Selected rate control algorithm ‘rtl_rc’
usbcoRe: registered new interface driver rtl8192cu
rtl8192cu 1-1:1.0 wlx0034f1812a4c: renamed from wlan0
rtl8192cu: MAC auto ON okay!
rtl8192cu: Tx queue select: 0x05
rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4
<==========

With kernels 4.9.x everything works properly. That extra message
(mentioned above) doesn’t appear at all.
It’s not a current consumption issue as well: the device consumes only
120mA.

Thanks for advises and directions.
-Sergey

Is this one of those really small modules, do you have a part number/Amazon
link I can take a look at it?

I ordered them directly from the vendor:

http://www.radi.com/modular71.htm

Yeah, those should be safe from the HDMI noise, that usually affects models with that chipset.

What’s the full uname -r of the last v4.14.x based kernel you tried?

Regards,

Try disabling musb's dma engine:

In /boot/uEnv.txt change:

cmdline=coherent_pool=1M net.ifnames=0 quiet

to

cmdline=coherent_pool=1M net.ifnames=0 musb_hdrc.use_dma=n quiet

and reboot...

Regards,

Excerpts from Robert Nelson's message from Fri 22-Jun-18 13:40:

> I built it yesterday‎ using your building scripts, it's 4.14.51-bone15.
>

Try disabling musb's dma engine:

In /boot/uEnv.txt change:

cmdline=coherent_pool=1M net.ifnames=0 quiet

to

cmdline=coherent_pool=1M net.ifnames=0 musb_hdrc.use_dma=n quiet

and reboot...

That works great!
Thank you very much, Robert!

So, how would I disable the musb's dma engine by default when building a kernel?
I'll have to rebuild the kernel anyway since I have my own config with
very limited number of drivers and options for an embedded system.

Thanks,
Sergey

sed -i -e 's:CONFIG_USB_TI_CPPI41_DMA:CONFIG_MUSB_PIO_ONLY:g' .config
make ARCH=arm menuconfig

should be enough, here's the full git diff

diff --git a/patches/defconfig b/patches/defconfig
index 7585507..aa5cb8c 100644
--- a/patches/defconfig
+++ b/patches/defconfig
@@ -4516,8 +4516,7 @@ CONFIG_USB_MUSB_AM335X_CHILD=y

Excerpts from Robert Nelson's message from Fri 22-Jun-18 13:56: