Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4159375pxv; Mon, 19 Jul 2021 18:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykCfFtaIrvydl4p/bxJWxyBe+rM/N51owm311dWjr0tMCfAYUqHnMMqfcLU3ztkTsOs4h8 X-Received: by 2002:a05:6602:3423:: with SMTP id n35mr21486809ioz.188.1626745781308; Mon, 19 Jul 2021 18:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626745781; cv=none; d=google.com; s=arc-20160816; b=jntNqv3bljs/JQtqDBIWazbIku+FI3le5PMK/FE+T0W2c66kWf79dp2/g/nf6IQMIb caUvlaCVqTVQvpmjTal0D1g8CjLeLThrY6xcD73NC1r+cimkplY/pk3AKF2/6FYTsB+V fBvBqaUKe4jdGcI7Y6U+R9YG69UyqlYlozhoWy7eZs7r4/5KuA8oV5yUqlOpoG64ot7n tY0EiHLUCCbfZ02Q8BaoIGQ+87ISykaKhQhjAkpJVe31FN8LMbXNOX5Ih+K68S3qWw0H gjRtt22NAw4HKditxzZoGqmEp3QFzBW81GEutmbP2UnRlF8BOwsz8L9sDSOublOOjP9D WiSw== 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=I3HTDSGupGXI3JIjOG4YBePSuqutxTU3WHF1wd0Bqdo=; b=lee+Cqdu0nnPpyX+SCeEFnhbBILg09QaXLMbo69l0z1b7ZU30LAtQlWSHjGqMChOPj BPTExpVRAxkoTsTT2E8ffOhtCkckrgSrPVEpgoiRamqOQ7LrGZ9AJDgO1K+47vOZZry2 ReG9BaFB7ylBue0LMtfzBX/YTnLdKi5eMVcVH+U2DLPWKYgcY+NX+aFCCz0MPYGD5+ua eTrOr0h9wnyBxW4Z/D/O9zBk0ltZApAgtnQw1fYBv7YzyV/+0mVmCAh/dC8qVnHg3cfl Ty0kgcJ03MSfMW1PhOUOdb4ZeJWYCefgoF51hPjxMIWvALZqChpUjY4emE1pb70KHeUz tgDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yTa7V+bH; 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 m9si21925887jaj.89.2021.07.19.18.49.29; Mon, 19 Jul 2021 18:49:41 -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=yTa7V+bH; 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 S1343624AbhGSPKy (ORCPT + 99 others); Mon, 19 Jul 2021 11:10:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343894AbhGSOsf (ORCPT ); Mon, 19 Jul 2021 10:48:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 018586127C; Mon, 19 Jul 2021 15:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708325; bh=pfH0Ji+8ZDpSskIgX+PwG5GckvMLIe/0t8YKozXpRVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yTa7V+bHeTAMYg0WPoeT4LMrY+r3FtFcoJxY+lW+DY1wnKL/ugWOpYBcxssKHoDRQ 6Tqy5RP1+QLXKT+SyHLbt6g8fQg10ASMzpcj2ezODAjC2w1YgtIRfQRjHNn9b0fbKH T7Ncp4fKWrJIeb5LM7c+rw4WSbYiDI5kI8ItyUyo= 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 4.14 268/315] power: supply: max17042: Do not enforce (incorrect) interrupt trigger type Date: Mon, 19 Jul 2021 16:52:37 +0200 Message-Id: <20210719144952.236851829@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@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 9c7eaaeda343..911d42366ef1 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -1051,7 +1051,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