lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210219215752.GA31435@amd>
Date:   Fri, 19 Feb 2021 22:57:53 +0100
From:   Pavel Machek <pavel@....cz>
To:     Tony Lindgren <tony@...mide.com>
Cc:     kernel list <linux-kernel@...r.kernel.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        linux-omap@...r.kernel.org, sre@...nel.org, nekit1000@...il.com,
        mpartap@....net, merlijn@...zup.org, martin_rysavy@...trum.cz,
        phone-devel@...r.kernel.org, maemo-leste@...ts.dyne.org,
        Carl Philipp Klemm <philipp@...s.xyz>
Subject: Re: Droid 4 charging

Hi!

> > (I'm using Leste 5.10 kernel here).
> > 
> > When battery is full, green light is off and 0.00A being drawn from
> > USB.
> > 
> > But that means that phone is now powered from battery, discharging
> > it... And soon charging starts again. (Pretty much immediately, for me)
> > 
> > That's bad ... right? It wears the battery out.
> 
> Well maintenance charging at 4.2V sure is better for the battery than
> what android is doing charging it at 4.31V contantly..

Well, 4.2 is better than 4.3, but I'm not sure about the rest.

> > If I turn off charging with echo 0 > input_current_limit, 0.2 to 0.4A
> > is drawn from USB, and battery is not discharged:
> > 
> > root@...uan-droid4:/sys/class/power_supply/usb# echo 0 >  input_current_limit
> > root@...uan-droid4:/sys/class/power_supply/usb# cat current_now
> > 0
> 
> Hmm so have you measured that setting the current limit to 0 actually
> draws something from the USB?

Yes, it does, if I do the echo when charge is done. (I have small USB
passthrough with volt and amp meters). It has been behaving weirdly in
other cases.p

> I recall clearing the ichrgr bits stops the vbus draw completely, but
> I could be wrong.
> 
> > Is that a better way to handle full battery?
> 
> We could experiment with switching over to usb power when the battery is
> full. Looking at the docs for mc1378 it might be possible that setting
> CPCAP_REG_CRM_FET_OVRD and clearing CPCAP_REG_CRM_FET_CTRL after the
> battery is full disables charging but still keep drawing power from
> the usb. I'd assume the current limit still needs to be nonzero there
> too? Totally untested..

I may be able to test patches...

> And switching back to battery power on usb disconnect will potentially
> only give us very little time based on the different line length for
> vbus and ground pins compared to data pins on the usb connector.. And
> uvos had some concerns about the battery capacity putting it back online,
> so adding him to Cc also.

You mean, we'd have to take interrupt and switch registers in order to
switch back to battery power, and system would crash if we did not
make it in time?

> Maybe just clearing ichrgr does all this already though and is enough.
> It should be measured on the vbus line.

It works for me... measuring current at the usb connector.

> And then we still need to restart the charger at some point, but that
> could happen based on much longer timeouts that what we currently have.

Li-ion batteries are very slow to self-discharge. This could timeout
could be week... or maybe a year.

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ