Dmesg flooded with RTW messages

Hi there,

Running the Debian Buster image and I noticed that the message log is beeing flooded with RTW messages like this:

[ 8812.022315] RTW: [HW_VAR_CHECK_TXBUF] Empty in 0 ms
[ 8812.022553] RTW: wlx74ee2a1c824e sleep m0=0x00000002, ori reg_0x4d4=0x00000000
[ 8816.087839] RTW: LeaveAllPowerSaveModeDirect.....
[ 8816.087857] RTW: rtw_hal_set_macaddr_port wlx74ee2a1c824e- hw port(0) mac_addr =74:ee:2a:1c:82:4e
[ 8816.088320] RTW: rtw_hal_get_macaddr_port wlx74ee2a1c824e- hw port(0) mac_addr =74:ee:2a:1c:82:4e
[ 8816.088328] RTW: wlx74ee2a1c824e- hw port(0) mac_addr =74:ee:2a:1c:82:4e
[ 8816.088570] RTW: rtw_hal_get_macaddr_port wlan1- hw port(1) mac_addr =76:ee:2a:1c:82:4e
[ 8816.088577] RTW: wlan1- hw port(1) mac_addr =76:ee:2a:1c:82:4e
[ 8816.114195] RTW: wlx74ee2a1c824e wakeup m0=0x00000002, ori reg_0x4d4=0x00000002
[ 8816.114328] RTW: survey done event(12) band:0 for wlx74ee2a1c824e
[ 8816.114396] RTW: rtw_indicate_scan_done(wlx74ee2a1c824e)
[ 8816.114475] RTW: rtw_indicate_scan_done(wlan1)
[ 8816.149332] RTW: ==>rtw_ps_processor .fw_state(8)
[ 8816.158696] RTW: ==>ips_enter cnts:142
[ 8816.158705] RTW: nolinked power save enter
[ 8816.158711] RTW: ===> rtw_ips_pwr_down...................
[ 8816.158716] RTW: ====> rtw_ips_dev_unload...
[ 8816.159316] RTW: usb_read_port_cancel
[ 8816.159437] RTW: usb_read_port_complete

I do recall that the Ubuntu images gave exactly this amount of verbosity.

Ho can I log only warn/error messages?

thanks, Martijn

Please show output of

cat /proc/cmdline
cat /proc/sys/kernel/printk

If first shows debug,remove it (uEnv.txt) or set level after boot.

https://elinux.org/Debugging_by_printing

Thanks for reaching out.

root@bpi-iot-ros-ai:~# cat /proc/cmdline
board=bpi-m4 console=earlycon=uart8250,mmio32,0x98007800 console=tty1 fbcon=map:0 console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait fsck.mode=force fsck.repair=yes service=linux sdmmc_on=0 loglevel=8 initcall_debug=0

root@bpi-iot-ros-ai:~# cat /proc/sys/kernel/printk
1	4	1	3

All checks out as it seems. Could the level be set wrongly on the RTW module itself? Can a module (8821cu) itself be silenced by doing some modprobe options?

Try removing

loglevel=8

From bootargs (maybe another var used in bootargs) in uEnv.txt

I don’t know that driver…maybe it is compiled with DEBUG option

Found it. The line is in the mmcblk0p1 partition:

~# mount /dev/mmcblk0p1 /mnt
~# grep bootopts /mnt/bananapi/bpi-m4/linux/uEnv.txt
#bootopts=loglevel=8 initcall_debug=0
bootopts=initcall_debug=0
abootargs=setenv bootargs board=${board} console=${console} root=${root} fsck.mode=force     fsck.repair=yes service=${service} sdmmc_on=${sdmmc_on} ${bootopts}

Is has no effect on the amount of logging so looks like the module itself is way too chatty. Since I do not need the RTL 8821CU WiFi anyway, I’ve blacklisted the module:

~# cat /etc/modprobe.d/blacklist.conf
blacklist 8821cu

Thanks for your help