Bug #1073
openMake rk818-bat stop spewing to serial console
70%
Description
It does periodic spewing like so:
root(tty)$ rk818-bat: changed: dsoc=42, rsoc=46, v=3673, ov=3863 c=-545, cap=1234, f=2708, st=charge off, hotdie=0 rk818-bat: dl=56, rl=56, v=3732, halt=0, halt_n=0, max=0, init=0, sw=0, calib=0, below0=0, force=0
This is really annoying on the serial console.
Updated by Hammel 11 months ago
BAT_INFO is a pr_info macro. The default console log level is set to
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15
in the defconfig. Additionally the kernel command line can be updated in src/bootloader/boot.txt to include
loglevel=3
to change it from the default to only printing errors.
Additional information can be found on the eLinux.org site or in this stackoverflow discussion.
Updated by Hammel 9 months ago
- Priority changed from Immediate to Urgent
- % Done changed from 50 to 70
- Severity changed from 03 - Medium to 02 - High
Experimented with this a bit. Setting loglevel=6 reduces console output considerably and also gets rid of the rk818-bat message. However, I want all those other messages, just not the rk818-bat message.
So I would probably want to patch the kernel driver to disable this. Since BAT_INFO() is used throughout the driver, and I only want to quiet the power changed message that pops up on the console repeatedly, I can just #if 0 the block of code. An alternative would be to add a sysfs entry to enable or disable it.
There is already a sysfs setup in rk818_bat_init_sysfs() that uses rk818_bat_attr[] which is a set of sysfs files/functions to enable. Currently the only sysfs function is bat_info_store() but it should be easy to convert rk818_bat_power_supply_changed() info a function that stuffs new values into module variables that can be queried from user space.
For now, just know that the message can be stopped by setting loglevel=6 in the boot.txt file. I'll consider submitting a patch for the driver later.