Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2937804imu; Sun, 11 Nov 2018 04:23:23 -0800 (PST) X-Google-Smtp-Source: AJdET5e/PTvJBqIcufl4l6MNKlwwQc7IdOmxRNskFpArSAN6U+7oNLbicbgq/yPXJ9cNF5YcdxEA X-Received: by 2002:a63:6506:: with SMTP id z6-v6mr13061456pgb.219.1541939003658; Sun, 11 Nov 2018 04:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541939003; cv=none; d=google.com; s=arc-20160816; b=IUuJm6/HhB3q/cQpS3kaZjJ70gW8J0HZ4olnnDZ+fpgQ0vC04cJKkS6KN+wpArxPYP V9rA/yhJSqzN2fMsoquSOtf7xgnbbsrUgnrD5wevsTeYMmya0ntK3L/a7zvPmrG31y8C 6nwFT9f2/QL2lxg5630YtQI8zl2ETm5rKyFTikhGS5ZTVNEU+ikFs/qSm54+EDz35RZA nB7sqZ+k0S0b4jyOCXntVWOwr57cf5T0R3w8xiveYajLHCFGVHVGCzlbwDDkEVqGuvAk R8SReLEgcoylhQx42ospLiWF9TuPyFpLd2a9miI2J3YnWHLUIZoQ5jp9IXxaPHE1TSbv am4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=835QrorTCkWqbCkwgA2ulOBVDpJfVc5E9PorIRMWn2I=; b=mv48NkOdCkNCm6SnUny28eqllukIp2mI877fiPmCmICqyx9dQ2Yqo8M8dLPjVrbPoX accFIjNSHo5jdQEHXzy9ELQTMUWsOd1ZhsphLbqDUsTjK+9VodFVZElOnjAnmewteb1F ZoR4EC8Avf0kQ1hcYR0FzdCyYQ0IwjECtF4a58ASG58BEDVRlOGAIuUkgh+1B5Li701F w5VMkTnK1Bt6Kz56rWWHazT3kILs7JflmuprKZ19/j8vBXkf/pZ2e/g9iJfeTTjz5moY RZEltxLBVA5+mZ9nBNxQPomsAinwLCLLSudDq8APNhJGEsrfX1ZaDAOQ6QOW7nKqqiCk +UXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b124-v6si15131575pfg.90.2018.11.11.04.23.07; Sun, 11 Nov 2018 04:23:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727732AbeKKWLO (ORCPT + 99 others); Sun, 11 Nov 2018 17:11:14 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:45097 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727480AbeKKWLN (ORCPT ); Sun, 11 Nov 2018 17:11:13 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id D5120806D1; Sun, 11 Nov 2018 13:22:42 +0100 (CET) Date: Sun, 11 Nov 2018 13:22:43 +0100 From: Pavel Machek To: Hans de Goede Cc: Daniel Drake , "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , sebastian.reichel@collabora.co.uk, Linux Kernel , linux@endlessm.com, =?iso-8859-1?Q?Jo=E3o?= Paulo Rechi Vita , =?iso-8859-1?Q?Jo=E3o?= Paulo Rechi Vita Subject: Re: [PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100% Message-ID: <20181111122243.GB28794@amd> References: <20181103065732.12134-1-jprvita@endlessm.com> <20181105091917.GD4439@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neYutvxvOLaeuPCA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --neYutvxvOLaeuPCA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun 2018-11-11 12:57:12, Hans de Goede wrote: > Hi, >=20 > On 11/7/18 5:53 AM, Daniel Drake wrote: > >On Mon, Nov 5, 2018 at 1:19 AM Pavel Machek 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. >=20 > 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. >=20 > Anu heurstics to decide that "not charging" is close enough to full > to report it as full to the user belongs in userspace IMHO. >=20 > 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. >=20 > 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. For the record, I don't think I'm okay with this. There's nothing special about 100% charge. This changes userland ABI and I don't think it has good enough reasons to do that. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --neYutvxvOLaeuPCA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlvoHxMACgkQMOfwapXb+vIIUQCguwFYiFzv+drOvbVcJxSDgTjM Br0AoLhAGWVQ+vX2BHEfgRYHRu6X1Cf/ =kwEp -----END PGP SIGNATURE----- --neYutvxvOLaeuPCA--