linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Tony Lindgren <tony@atomide.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, linux-omap@vger.kernel.org,
	Merlijn Wajer <merlijn@wizzup.org>
Subject: Re: [PATCH 2/3] power: supply: cpcap-battery: Check voltage before orderly_poweroff
Date: Thu, 19 Sep 2019 11:14:34 +0200	[thread overview]
Message-ID: <20190919091434.GB9644@amd> (raw)
In-Reply-To: <20190917213501.16907-3-tony@atomide.com>

[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]

On Tue 2019-09-17 14:35:00, Tony Lindgren wrote:
> We can get the low voltage interrupt trigger sometimes way too early,
> maybe because of CPU load spikes. This causes orderly_poweroff() be
> called too easily.
> 
> Let's check the voltage before orderly_poweroff in case it was not
> yet a permanent condition. We will be getting more interrupts anyways
> if the condition persists.
> 
> Let's also show the measured voltages for low battery and battery
> empty warnings since we have them.

Well, this is decision that will shorten battery lifetime. There's
very little capacity left when battery is down to 3.3V...

What kind of "way too early" do you see?

> @@ -562,12 +562,15 @@ static irqreturn_t cpcap_battery_irq_thread(int irq, void *data)
>  	switch (d->action) {
>  	case CPCAP_BATTERY_IRQ_ACTION_BATTERY_LOW:
>  		if (latest->current_ua >= 0)
> -			dev_warn(ddata->dev, "Battery low at 3.3V!\n");
> +			dev_warn(ddata->dev, "Battery low at %i!\n",
> +				latest->voltage);
>  		break;

I'd still leave unit ("uV"?) there. Or do /1000, as and display mV, as
our 
> -				  "Battery empty at 3.1V, powering off\n");
> +				  "Battery empty at %i, powering off\n",
> +				  latest->voltage);
>  			orderly_poweroff(true);

Same here.

Plus I see bigger problem: shutdown from mainline seems to leave
something powered in the phone (I believe I seen USB charge pump, for
example), so the battery will be completely empty next time I attempt
to use the phone. (I learned to reboot into stock android and shutdown
there).

Phone should last days when powered off, but it seems to only last
hours.

Unfortunately I don't know how to debug that :-(.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2019-09-19  9:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 21:34 [PATCH 0/3] cpcap charger and battery fixes Tony Lindgren
2019-09-17 21:34 ` [PATCH 1/3] power: supply: cpcap-charger: Limit voltage to 4.2V for battery Tony Lindgren
2019-09-19  9:05   ` Pavel Machek
2019-09-20 14:03     ` Tony Lindgren
2019-09-17 21:35 ` [PATCH 2/3] power: supply: cpcap-battery: Check voltage before orderly_poweroff Tony Lindgren
2019-09-19  9:14   ` Pavel Machek [this message]
2019-09-20 14:12     ` Tony Lindgren
2019-09-22 18:00       ` Tony Lindgren
2019-09-17 21:35 ` [PATCH 3/3] power: supply: cpcap-charger: Improve battery detection Tony Lindgren
2019-09-19  9:19   ` Pavel Machek
2019-09-20 14:18     ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919091434.GB9644@amd \
    --to=pavel@ucw.cz \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).