Re: [PATCH v2] power: supply_core: Pass pointer to battery info
From: Vaittinen, Matti <hidden>
Date: 2021-12-14 06:53:41
On 12/14/21 08:44, Matti Vaittinen wrote:
Hi deee Ho peeps, On 12/13/21 11:23, Matti Vaittinen wrote:quoted
On 12/10/21 07:57, Matti Vaittinen wrote:quoted
On Thu, Dec 9, 2021 at 2:46 AM Linus Walleij [off-list ref] wrote:quoted
quoted
Also I would love if you could test v2 on hardware!
It appears the patch worked as expected - but it also appears the BD99954 driver does not handle missing info too well... I typoed the trickle-charger current property in DT - and as a result the driver decided -EINVAL to be valid value (just too large) and set the largest current BD99954 supports for trickle-charging...
I should have looked this more carefully. It appears the BD99954 does check for the -EINVAL - but the power_supply_core does not initialize the tricklecharge_current_ua to -EINVAL.
Linus, want to fix this while at it - or do you prefer me to patch the BD99954 with some sanity checks? I think it'd be nice to get the fixes in stable so it might be best to add the sanity checks before changing the battery-info allocation - that might be nicer for the stable folks. (I guess you have plenty of other things to code + some IRL tasks as well ...;] So, I can patch this but it means there is likely to be some conflicts with your series. Hence I thought I'll ask if you wish to add checks for uninitialized battery-info values)
I think this is a trivial thing to fix and won't be too hard a conflict to resolve :) So I'll just send a patch Sorry for the hassle. So, what it's worth: Reviewed-By: Matti Vaittinen <redacted> Tested-By: Matti Vaittinen <redacted> -- The Linux Kernel guy at ROHM Semiconductors Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~ this year is the year of a signature writers block ~~