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 X-Spam-Level: X-Spam-Status: No, score=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE9DCC11F69 for ; Sat, 10 Jul 2021 23:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 962A0613DC for ; Sat, 10 Jul 2021 23:51:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbhGJXyD (ORCPT ); Sat, 10 Jul 2021 19:54:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbhGJXxM (ORCPT ); Sat, 10 Jul 2021 19:53:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E9B4613B6; Sat, 10 Jul 2021 23:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625961027; bh=I9NWyjJHAW2z+DIDt60z2A6Gun9QhxQbQHcbEkHjgF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eN/RoR6o0Dd4GJyNdXo6YWVhbvdJe4h8GcoJtPVir1x2xB/0SfqJae0zrQQwV+GhR ko2YZ0AspzcXtS/2w65QWeKbItWnO060win3l8BAW9AGD8ml0K/lZd48XcA5ePjE3l OYGgVg+SU2+aGY4PKm6PviY2PCaFtx/Dj0KcXB39UCMcGMxTzu8EonikxOA4+xMbzV nh5o42ZJY++UURFvMb04IdOBX52UNg2slCjJXmzdaKfsX5Ukaq2ZSzXhW6k2gkUT14 KeGdw3h0Q+7oW+glMrldeg6oWa+/vWKrpl+f1DbbhorF/Zj7Oq+3yuUYM82ctSGYBQ WcdTGGy5ENpyw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Krzysztof Kozlowski , Sebastian Reichel , Sasha Levin , linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 08/37] power: supply: max17042: Do not enforce (incorrect) interrupt trigger type Date: Sat, 10 Jul 2021 19:49:46 -0400 Message-Id: <20210710235016.3221124-8-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710235016.3221124-1-sashal@kernel.org> References: <20210710235016.3221124-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 7fbf6b731bca347700e460d94b130f9d734b33e9 ] Interrupt line can be configured on different hardware in different way, even inverted. Therefore driver should not enforce specific trigger type - edge falling - but instead rely on Devicetree to configure it. The Maxim 17047/77693 datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU therefore the edge falling is not correct. The interrupt line is shared between PMIC and RTC driver, so using level sensitive interrupt is here especially important to avoid races. With an edge configuration in case if first PMIC signals interrupt followed shortly after by the RTC, the interrupt might not be yet cleared/acked thus the second one would not be noticed. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/max17042_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 2e9672fe4df1..794caf03658d 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -1094,7 +1094,7 @@ static int max17042_probe(struct i2c_client *client, } if (client->irq) { - unsigned int flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; + unsigned int flags = IRQF_ONESHOT; /* * On ACPI systems the IRQ may be handled by ACPI-event code, -- 2.30.2