Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2901009imu; Sun, 11 Nov 2018 03:32:48 -0800 (PST) X-Google-Smtp-Source: AJdET5d194nbXUnEGafIq0LBmVbQszboyKJiGR6aFnIqGl0PCtEsRxDXmkSie6P9HimP37kFsSRg X-Received: by 2002:a63:ed15:: with SMTP id d21mr9752576pgi.305.1541935968886; Sun, 11 Nov 2018 03:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541935968; cv=none; d=google.com; s=arc-20160816; b=iD+kq+tMSzL0IFJVt6LoHWaKWU9z0Ak8w+S89tMDuVz9dDWU6+ykqj8Wn8dP7cqjvY d/Kj18M5DtBaUKeTWmppZpRYE4WL99mPwrtOlGLAa84sxr/C5M5IHGR/nxdxgTffuQA2 yQEQeQgQNezkoAun+fHDKDaHUeuzs9H3mhwABKhT+RLcR9d2mXOTlzxl6dibLXwUGb9X e7P9+sxzYVYnWirggSIKqh6MDQaZkYnYZK57jsGiMBebnpiobAb1GkABJt/DoVjM1qKW CUByzUrW5llFNnpV1XdQn9iKj5aAD/JkIvgm+FZ2T+C/5Bby94QyfFjy+undJoeBA8Yi 44hw== 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=BVmYCCo9bt6XJSpzaEzX/8537rn7FafUa+qpI5MjWm8=; b=zohxrntPhShnp7TS2oHz6446n8+lVt/pegDz+o4tr/iidcKLNOJwrjqkgtC8nHTYcQ dMQdPH4ZYzPN0sbVaeKzAmQR40jatm/fay+ynokzO0Jz//ZboB9I7Bt4kmce2VSyZbva AHWV8uRGK0mf7yq+kx0BBpRna6RYOBhxwynD80cTOvbdipKXoucCAJSAqZd6+D631cdj e3wJp1q0BYFDdHpvM+SyiMKMB9lYpTvyLoC2KRlnQKCk5RBeUbS2aL4h3j8beUNMaxIb 7Ghnh2H2orjr/wYTs4Pc86y97syIJgkNE2nakLf6jU+vhIQlOmWiITkeWH2iXq0k4087 LAUQ== 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 u129-v6si7407722pfb.201.2018.11.11.03.32.33; Sun, 11 Nov 2018 03:32:48 -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 S1727981AbeKKVSu (ORCPT + 99 others); Sun, 11 Nov 2018 16:18:50 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:44201 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727427AbeKKVSu (ORCPT ); Sun, 11 Nov 2018 16:18:50 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id ECCD0806BB; Sun, 11 Nov 2018 12:30:27 +0100 (CET) Date: Sun, 11 Nov 2018 12:30:29 +0100 From: Pavel Machek To: =?iso-8859-1?Q?Jo=E3o?= Paulo Rechi Vita Cc: "Rafael J . Wysocki" , Len Brown , Hans de Goede , linux-acpi@vger.kernel.org, Daniel Drake , Sebastian Reichel , LKML , linux@endlessm.com, =?iso-8859-1?Q?Jo=E3o?= Paulo Rechi Vita Subject: Re: [PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100% Message-ID: <20181111113029.GD27666@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="UfEAyuTBtIjiZzX6" 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 --UfEAyuTBtIjiZzX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > * was plugged in and the device thus did not start a new charg= e cycle. > > > */ > > > if ((battery_ac_is_broken || power_supply_is_system_supplied())= && > > > - battery->rate_now =3D=3D 0) > > > + battery->rate_now =3D=3D 0) { > > > + if (battery->capacity_now && battery->full_charge_capac= ity && > > > + battery->capacity_now / battery->full_charge_capaci= ty =3D=3D 1) > > > + return POWER_SUPPLY_STATUS_FULL; > > > > Division? Really? >=20 > If you look further down in acpi_battery_get_property, that is how the > capacity property is calculated. Do you have a better suggestion? if (battery->capacity_now >=3D battery->full_charge_capacity) ? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --UfEAyuTBtIjiZzX6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlvoEtUACgkQMOfwapXb+vI9LACfXmYl9qips5knDC4Qb89sNEr4 gQAAn1QbGPEm+K7c74zKapszZ12q4eJc =rdiM -----END PGP SIGNATURE----- --UfEAyuTBtIjiZzX6--