[Letux-kernel] [PATCH 0/6] bq2429x: Clean up driver for future fixes
H. Nikolaus Schaller
hns at goldelico.com
Thu Aug 13 17:25:58 CEST 2020
Hi,
> Am 13.08.2020 um 02:51 schrieb Nick Elsmore <nicholaselsmore at gmail.com>:
>
> Hi all,
>
> I have identified a few bugs and features I would like to fix and add to the existing bq2429x driver. They are listed below. To begin this effort, I am first submitting a number of patches to clean the driver up and prepare it for eventual submission to mainline.
>
> Identified bugs:
> * At system startup, device information is not populated by the power_supply subsystem and is not present in sysfs. It takes 30s to multiple minutes before this information is available.
Looks good to have this.
> * Interrupts/poll events are often missed, possibly due to hangups in the work queue.
I haven't observed this in my tests. Do you have a specific example? Or a theory when and why it can happen?
> * Plug/unplug events are not properly detected, due to either work queue hangups as described above or faulty logic determining plug status
Yes, plug/unplug detection is quite some guesswork. A better strategy would be to connect to the USB-PHY...
> * Watchdog is left on (if not disabled by bootloader) and not serviced.
It should be disabled by bootloader and kept in disabled state by the driver.
Contrary to what we all would suspect it is not a safety watchdog which would e.g. cut processor power or charging after a kernel panic or stall.
It just a mechanism to auto-reset the bq2429x registers to default values which could also be done through writing all registers.
So I do not see how to use it for practical purposes.
> If IRQ or poll events in the work queue are not serviced due to the hangups described above, the watchdog will trigger.
This is something we must better understand: why it can happen at all that events are not serviced. Maybe we are missing a lock?
> This is not properly handled.
> * The following properties are missing:
> * POWER_SUPPLY_PROP_HEALTH
I am not sure if the charger can report a reasonable value for health.
> * POWER_SUPPLY_PROP_PRECHARGE_CURRENT
> * POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT
ok!
Generally I find the patches good from a cursory glance, but I have to do a life check since it is not easy to see from the git diffs, what is changed (any why) and if all functions are transformed correctly. This takes at least until next week.
BR and thanks,
Nikolaus
More information about the Letux-kernel
mailing list