Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3668675pxv; Mon, 26 Jul 2021 09:04:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpYZZazQwTG7P3hhjWdH/IsnQL4poYsg4bIunZfU1XDGcLMmfjNI7HtdTOtamh3tULDD+I X-Received: by 2002:a5d:64cc:: with SMTP id f12mr19960264wri.201.1627315451706; Mon, 26 Jul 2021 09:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315451; cv=none; d=google.com; s=arc-20160816; b=vjltlijxJ7FkyyrI4Ae0BVQaDJRHSyfvck3/uOkLIWyxXHZIGjuUxtRp//fGifYfqn Hq3FK8Cj/r52kOlyxINobmdQq0Z3C/ZAKZAnuj2cIr5d6JfUjGHZAeQGzL3z2siuYNdV krBSlxkkF1gJzi1uKWpImElhLeVAeustL6uAItRC0Le7Y2gR/g0LR2v9kg01oVUTOufx eajw7OSjJ7R++uWG2Qv/cf7FFwNn4w5LIoLbZcJHi2bBxpOTNCfIeoLoC5RV/oxUijZ6 uCcS48xyfoSUjgWnLJEqQuXBObnJ+sZTvhoFIfaXPTZl/BFOYkDa4tx/agn/Ikq2JLvd fV3Q== 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=CKAUzVBJW6UD0vE/DC6lv9fgnHgLgV7d5aHqv+0Blsg=; b=Ux0+RabFdOtVEZAyq5twuuHAWKAnR/tLC00eLgm9WAb9CZQbxXdP4pftd4qvBEdYdk D54MNqO2tXE/hyQRthoZy4uj3IaIEdScVwYjQIbMnduRbBd9LvZh+XbgeLslTXuj2AoX QN73V1tCw+8Wl3mPp7ibcRp/twdHm0y2JyH5HBHlUdnYBsCq1uadPrCC42P/O5WduE7G 2own/+C6e/0mggNsWa6DXcjqqlyYgL2B900IhYI5ycvwPyZxj+2kY3cRVAb63B8Fgpz7 c7gR+TSyVl7spWVGkewj1cY0wIMqhpbi5CQBpFzUPkJxkJpRiO3RSMoIgDxEe0gHdPFt hnPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="sE+LLua/"; 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 p31si338791edb.554.2021.07.26.09.03.47; Mon, 26 Jul 2021 09:04:11 -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="sE+LLua/"; 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 S237061AbhGZPUm (ORCPT + 99 others); Mon, 26 Jul 2021 11:20:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:51076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237252AbhGZPKb (ORCPT ); Mon, 26 Jul 2021 11:10:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C12BD6056C; Mon, 26 Jul 2021 15:50:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314660; bh=0FQ45pWstN+Zlkt7RQ/AP0WjMo6LEH/8ijahYy65CRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sE+LLua/X5Vkrl1HO2wQi4UBC4murCFuEIKVzFd8HefZrlabXbsHLq799xFxSfXCS WQ9O6Zd1scSvoEEku0ike/p00UpX0lMcAIQDj7r1CAFuF/msl/uQWXkYfuXpoUYwwD MYsns64aDVKgnVlRAVtlZv/2NJbEKTWp1EhRhJ6s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Alexandre Belloni , Sasha Levin Subject: [PATCH 4.19 029/120] rtc: max77686: Do not enforce (incorrect) interrupt trigger type Date: Mon, 26 Jul 2021 17:38:01 +0200 Message-Id: <20210726153833.331094468@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153832.339431936@linuxfoundation.org> References: <20210726153832.339431936@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 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 4aff349ae301..8e09450d11a6 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -710,8 +710,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