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]
Date:   Thu, 01 Jun 2017 16:43:15 +0100
From:   Ben Hutchings <ben@...adent.org.uk>
To:     linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC:     akpm@...ux-foundation.org, "Thomas Elste" <thomas.elste@...s.de>,
        "Sebastian Reichel" <sre@...nel.org>
Subject: [PATCH 3.16 061/212] power: bq24190_charger: Change first_time
 flag reset condition

3.16.44-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Elste <thomas.elste@...s.de>

commit cd054ee16580690830297dbda0abe9c184276d6a upstream.

The initial register reset of BQ24190 generates a charger status change
whose propagation via power_supply_changed is prevented using a flag.
This flag gets never reset so all following events are ignored as well
leading for example to userspace not detecting charger connects/disconnects.

Therefor change the reset condition of first_time flag, so only the
propagation of the first charger status change is prevented.

Signed-off-by: Thomas Elste <thomas.elste@...s.de>
Signed-off-by: Sebastian Reichel <sre@...nel.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
 drivers/power/bq24190_charger.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--- a/drivers/power/bq24190_charger.c
+++ b/drivers/power/bq24190_charger.c
@@ -1268,10 +1268,13 @@ static irqreturn_t bq24190_irq_handler_t
 	 * register reset so we should ignore that one (the very first
 	 * interrupt received).
 	 */
-	if (alert_userspace && !bdi->first_time) {
-		power_supply_changed(&bdi->charger);
-		power_supply_changed(&bdi->battery);
-		bdi->first_time = false;
+	if (alert_userspace) {
+		if (!bdi->first_time) {
+			power_supply_changed(&bdi->charger);
+			power_supply_changed(&bdi->battery);
+		} else {
+			bdi->first_time = false;
+		}
 	}
 
 out:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ