This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ27421-G1: bq27421-g1

Part Number: BQ27421-G1

Hi, I have a support thread on the Linux forum for this issue, but the TI representative has directed me to this forum to handle one aspect of the problem I'm having.

First, I'll provide some background.  We are running Linaro 4.4.9 with the PREEMPT RT patch on the Variscite SD410 SOM.  We have connected the bq27421-g1 to the SOM and verified functionality with i2cdetect and i2cget commands.  We installed the bq27xxx_battery driver, and initially it did not work.  After applying these two patches: marc.info/ and patchwork.kernel.org/.../, it works in the aspect that it creates and updates the filesystem under /sys/class/power_supply, but it exhibits problem that makes SOM unusable.

Here's the problem.  Something the driver does causes the syslog to constantly overflow.  This behavior begins the instant we load the driver and it stops the instant we unload the driver.  The only dmesg entry available in the syslog contains the following, repeatedly;

[  144.049378] systemd-journald[1489]: /dev/kmsg buffer overrun, some messages lost.

The TI rep handling this on the Linux form said the following.  I'm just taking the most relevant excerpts.

Looks like, bq27xxx_battery_irq_handler_thread() - interrupt is occurring continuously which calls bq27xxx_battery_update() -> power_supply_changed() calls this uevent

Yeah it is updating the battery values way too often. May be the fuel gauge and battery needs some kind of calibration(which I am not sure about).

I am taking guess. But there is a flow [flaw] in code to tell if battery is calibrated or not.

Here's a link to the entire support thread: e2e.ti.com/.../2168095

Can TI provide guidance for eliminating this problem?

Thanks,
Brian

  • Calibration won't affect interrupts to the extent that the gauge will issue interrupts continuously. You can check the gauge configuration and your hardware for correct interrupt signaling.

  • I have found the answer to the syslog overflow problem. Apparently, kernel config items can cause this with the presence of an I2C or power supply device, the bq27421-g1 being both of those.

    CONFIG_POWER_SUPPLY_DEBUG
    CONFIG_I2C_DEBUG_CORE

    bugs.freedesktop.org/show_bug.cgi

    This URL indicates that to avoid this disable one of those two config items. I only had CONFIG_POWER_SUPPLY_DEBUG enabled, and the problem existed. I had to disable it while already having CONFIG_I2C_DEBUG_CORE disabled to get rid of the problem.