linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Daniel Drake <drake@endlessm.com>, pavel@ucw.cz
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Len Brown" <lenb@kernel.org>,
	"ACPI Devel Maling List" <linux-acpi@vger.kernel.org>,
	sebastian.reichel@collabora.co.uk,
	"Linux Kernel" <linux-kernel@vger.kernel.org>,
	linux@endlessm.com,
	"João Paulo Rechi Vita" <jprvita@endlessm.com>,
	"João Paulo Rechi Vita" <jprvita@gmail.com>
Subject: Re: [PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100%
Date: Sun, 11 Nov 2018 12:57:12 +0100	[thread overview]
Message-ID: <c883a2be-e772-2e18-f074-d2ad5f27f42b@redhat.com> (raw)
In-Reply-To: <CAD8Lp46Go79C_xOkzM-hq4umET1M62Ofqw48swn1JNocifET3Q@mail.gmail.com>

Hi,

On 11/7/18 5:53 AM, Daniel Drake wrote:
> On Mon, Nov 5, 2018 at 1:19 AM Pavel Machek <pavel@ucw.cz> wrote:
>> Plus, I don't think "100% charge" is right test for "battery full". At
>> least on thinkpads, there's configuration option, and it is common
>> _not_ to charge batterry above 95% or so (to increase its lifetime).
> 
> Hans also touched on this area in his response:
> 
>> As for this kernel-side fix I do not believe that fixing thus in
>> the kernel is the right thing to do. We try to stay away from
>> heuristics using full_charge_capacity in the kernel since that
>> is not really reliable / deterministic.
> 
> I'm not fully convinced by this argument though.
> 
> The ACPI spec is not very clear on what conditions you should apply to
> decide when the battery is full. Instead, ACPI seems to provide a
> pretty decent amount of data, and the decision about whether to
> interpret that as "battery full" is left for consumers.

Right, but in this case the "discharging" status bit is explicitly
set, to me it feels wrong to report "full", when the firmware
is reporting "discharging" IMHO, at best we are "not charging"
(on AC, below the threshold where a new charge cycle starts) and
that is what we are currently reporting.

Anu heurstics to decide that "not charging" is close enough to full
to report it as full to the user belongs in userspace IMHO.

Anyways this ultimately is Rafael's call. If Rafael is ok with this
patch then I would like to see Pavel's comment addressed and otherwise
it is fine with me.

Note that we will still often get the case where a laptop is charged,
reports full, is unplugged for 5 minutes and then replugged and then
reports a capacity of 97% combined with "not charging", so we will
still need to fix userspace to handle this.

Rafael, what is your take on this?

Regards,

Hans

  reply	other threads:[~2018-11-11 11:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-03  6:57 [PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100% João Paulo Rechi Vita
2018-11-03 11:28 ` Hans de Goede
2018-11-06 20:14   ` João Paulo Rechi Vita
2018-11-05  9:19 ` Pavel Machek
2018-11-06 20:34   ` João Paulo Rechi Vita
2018-11-07  4:53     ` Daniel Drake
2018-11-11 11:57       ` Hans de Goede [this message]
2018-11-11 12:22         ` Pavel Machek
2018-11-20  2:12           ` João Paulo Rechi Vita
2018-11-20  9:16             ` Pavel Machek
2018-11-11 11:30     ` Pavel Machek

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=c883a2be-e772-2e18-f074-d2ad5f27f42b@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=drake@endlessm.com \
    --cc=jprvita@endlessm.com \
    --cc=jprvita@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=sebastian.reichel@collabora.co.uk \
    /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).