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.7 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=unavailable 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 763B0C12002 for ; Wed, 14 Jul 2021 20:04:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 606B8613D1 for ; Wed, 14 Jul 2021 20:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239792AbhGNUHE (ORCPT ); Wed, 14 Jul 2021 16:07:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:49730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238629AbhGNTvU (ORCPT ); Wed, 14 Jul 2021 15:51:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 66B6D613EB; Wed, 14 Jul 2021 19:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626292108; bh=l0Cw9TsyCc7qYbac/t7+DIPSgHI2IXBGitlxGGgv+sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFcYLkg/ac9j5KWphHdQfVclwufVumdtRAkcT+M7S3ooLLuU2yTK9RNdLe01/LQOA XTt6W6F4U2ICXsZxjNQl1PRK9WCG5poghSbSb0iRtrbPotqtCO9Idxy/OEQUeG+oWs nCoMoT5fARXwj8Wl6xMQ0hu1LD1JJbhw4rYmZK9Eqn7regHjXANyV80Nb/juGnrKJu FhbDBHE8xOABlVVZUjFCICe9EnSyECEmcZILeaTEQAWHrEXqEH/fY6R/UScTK0AS2q duD2gBvC/eMIt/pkTKP/p1z4RaL/yWei8+24Z5Y0akF1vSEGcLlJ9iOIKTuK+/cq4+ b4zt5+ftT9YtQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Krzysztof Kozlowski , Alexandre Belloni , Sasha Levin , linux-rtc@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 15/18] rtc: max77686: Do not enforce (incorrect) interrupt trigger type Date: Wed, 14 Jul 2021 15:48:03 -0400 Message-Id: <20210714194806.55962-15-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210714194806.55962-1-sashal@kernel.org> References: <20210714194806.55962-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: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 742b0d7e15c333303daad4856de0764f4bc83601 ] 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 77686 datasheet describes 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: Alexandre Belloni Link: https://lore.kernel.org/r/20210526172036.183223-6-krzysztof.kozlowski@canonical.com Signed-off-by: Sasha Levin --- drivers/rtc/rtc-max77686.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index 182fdd00e290..ecd61573dd31 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -718,8 +718,8 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) add_rtc_irq: ret = regmap_add_irq_chip(info->rtc_regmap, info->rtc_irq, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | - IRQF_SHARED, 0, info->drv_data->rtc_irq_chip, + IRQF_ONESHOT | IRQF_SHARED, + 0, info->drv_data->rtc_irq_chip, &info->rtc_irq_data); if (ret < 0) { dev_err(info->dev, "Failed to add RTC irq chip: %d\n", ret); -- 2.30.2