Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3889830pxv; Mon, 19 Jul 2021 11:12:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiWYn1K7ghUoBUA+Q/0d+J520Was+F5gt9+5jQ0/kCmhb0KmFa5cUzvpzXxpf9CuX4iYJK X-Received: by 2002:aa7:c4c7:: with SMTP id p7mr35496485edr.290.1626718280242; Mon, 19 Jul 2021 11:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626718280; cv=none; d=google.com; s=arc-20160816; b=pOIawimiwfSgj4sIRSL4KYKCWOshw6tgVuRaQFEKouODBt3Fjz8jn1ZE8e5NzyYd8q UUG8h66KIR9Fi09yCEiYlEkuFRdcw4jMFBrxNRIDQnwXtZIeA24FWkcdh1zCxDbx+ccq kWXvcZWLIt5eMBTWrCoTeh1sjd0F/knSEQ9fbpZNqq3CMKakMy9dN+U6uED+5INGbRKv jGp8lCWZiQLJqNds/XcJ8BIAJpdAdvs/uolcUBXzcV1ebI+GhGQqLynBE+dcXTLhLqKn 0oKdvPTQ6+O6hyoPKINcn4qWb6CKz7bvxxDpbfecag8a2dps7P+c23chipkdCIw9sh1E dDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t7UNCx/voWcTsY6RnqbySVEtvbB1JYbJ3xJfcg4OzJs=; b=Dk4UNqDMBYtKukG4Q2uYtUBtzaY8YwrS95Bsvz3qr7VVd+CLQz/mA8o51KH3LSYSIq bJAKQ2o6/pmwxZNNkwKuZR2m/+m4CH3bUaLTr6MOzbrS9iRJAHi320alHvtl1lqftu9H JDUpD5wW1e32kva0mjbrRt+IZKiMf1RRbHPyhhGbwtZfouQvVt/s/J0FpLjc+dkpn8KK yDqicJyatYn/JU65taPam6Iyg1i9sZPuZzRW2KfojReQ2zIeN8r67xBvRKm9uSBmhkUO Y2FCDJEh2gN8GrXVJJ/9GPHCAz7n2gZweEpnBz4S5zBZTyM1f52s+J9gxMv4jdQfqbY2 RTjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CkAp36jJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si29397698edm.532.2021.07.19.11.10.57; Mon, 19 Jul 2021 11:11:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CkAp36jJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379347AbhGSR0u (ORCPT + 99 others); Mon, 19 Jul 2021 13:26:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:45034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348920AbhGSPog (ORCPT ); Mon, 19 Jul 2021 11:44:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8997361490; Mon, 19 Jul 2021 16:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711804; bh=zWPWy9z0d0S0lEkxJfttdaXSj32THijNC1L5hxKEctI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CkAp36jJrEbfpOhE6y7qKyVF1nS3hhwYGAW6+GRFzVvGb3/7l7ne+3a9/XQ7QfG4o 1EHxkQl7eyx5x9CHJ43WZwRXL/W9/fQb63LLnlHJaMNehcwq5sMUXd8CFc9PmBEjm+ 3hBJs1geUHLeVyis4AbtQVxeZBO6ig3ZyzAz8iws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.12 138/292] power: supply: max17042: Do not enforce (incorrect) interrupt trigger type Date: Mon, 19 Jul 2021 16:53:20 +0200 Message-Id: <20210719144947.022272381@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 79d4b5988360..8117ecabe31c 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -1104,7 +1104,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