From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61180C433F5 for ; Sun, 14 Nov 2021 14:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4522860EE7 for ; Sun, 14 Nov 2021 14:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbhKNOiJ (ORCPT ); Sun, 14 Nov 2021 09:38:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:33874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbhKNOh4 (ORCPT ); Sun, 14 Nov 2021 09:37:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3182A60EE7; Sun, 14 Nov 2021 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636900502; bh=Gt/TuF/GQNGN90vpqr7uWoytqZOLWB7hdCr/9vAZmJY=; h=Subject:To:Cc:From:Date:From; b=KZrvEEOIY4bPo2KAjl1mXfzpUFUAqe46y7K+8qDVFYwjGw4dYnQNBLQJYo1MevOZP qc9bpPPBlt8UXyhJB8qC3OId1Gxo61ctXNrETWFH1+dMIW9lxsiqm2oPyrqHcUxX+/ 2MHFuLeAcnGx+OF9ETne6BC0B/GmjFgZ72E9+zvY= Subject: FAILED: patch "[PATCH] power: supply: max17042_battery: Clear status bits in" failed to apply to 5.4-stable tree To: sebastian.krzyszkowiak@puri.sm, krzysztof.kozlowski@canonical.com, sebastian.reichel@collabora.com, stable@vger.kernel.org Cc: From: Date: Sun, 14 Nov 2021 15:34:52 +0100 Message-ID: <1636900492203186@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0cf48167b87e388fa1268c9fe6d2443ae7f43d8a Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Tue, 14 Sep 2021 14:18:05 +0200 Subject: [PATCH] power: supply: max17042_battery: Clear status bits in interrupt handler The gauge requires us to clear the status bits manually for some alerts to be properly dismissed. Previously the IRQ was configured to react only on falling edge, which wasn't technically correct (the ALRT line is active low), but it had a happy side-effect of preventing interrupt storms on uncleared alerts from happening. Fixes: 7fbf6b731bca ("power: supply: max17042: Do not enforce (incorrect) interrupt trigger type") Cc: Signed-off-by: Sebastian Krzyszkowiak Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 32f331480487..2eb61856f3e4 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -879,6 +879,10 @@ static irqreturn_t max17042_thread_handler(int id, void *dev) max17042_set_soc_threshold(chip, 1); } + /* we implicitly handle all alerts via power_supply_changed */ + regmap_clear_bits(chip->regmap, MAX17042_STATUS, + 0xFFFF & ~(STATUS_POR_BIT | STATUS_BST_BIT)); + power_supply_changed(chip->battery); return IRQ_HANDLED; }