Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6135334rdb; Mon, 18 Sep 2023 05:25:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlYDxakgiXIyo2TwpW1IyaLfnQNgNB130AWOrs+nxEMVG0Rh2S3ZyfRI04yC4hATFFuu3R X-Received: by 2002:a05:6830:100d:b0:6b7:4a52:a33a with SMTP id a13-20020a056830100d00b006b74a52a33amr9318427otp.14.1695039923588; Mon, 18 Sep 2023 05:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695039923; cv=none; d=google.com; s=arc-20160816; b=Io3Aw3H9zgXhgvLoEOg2GqalLwYfdU4U2MejDds2dCdSPm/5G+fwyTE32N5OYz9+qx cYw3813m7tuE89L2+w+GMqcsSVxVrBvdoTswJE+J+bD32RENKQYpIiHgAee3chAcsLsf Lc8Gl9d0hTtvLwURy99fY+RZHVysTqQgeZD7tWy5TnU6QLUZJav5uGkHIQEc9QQq94xP y9LyhE5/OialtxDjjzQuuSZNtQBu9Vk9oBVazZjdYV8xbr2vG0mzKV15UdaCClmTcH0g yL491fpgYPNPay/0VMyg3wCQNC2j/R0cmRfPaZS4hJdn72DobiP2MaWVj/ITH/5t3gtV igYw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kWAYsRcLVJHP56QGfOuoyxt3WMyTP8X5tyuHao+rugo=; fh=sWH11FnHMfCkHSU9kXlYjtdyZVAjuuR7mMUGHavtm3Q=; b=0c30csJMOk1j6ltzr0hlOypM1OkKjTfZDV+QLPrIXMAqAA/7TJDNyQorNRnI0LEQDz xUAPUVYUQymgPWYRp62eeWYSnL+1hQVAoWcJ5Cqne1MacNWjObRvgEQrmoT0wUa9Hgva 2idcPrMsFRI8bEBLLdWbwbnlNznfuMHcmbOo/+cZndxnsOfmajfFbX/wdLQSvMXNhPqY c0NRdi3Yr8rQAOTxpjAUmzlFEVM/dgBTC41OUN2OUWH8JlS/GxFjQjRd5p477E/ES3ip kXOze4zvDhL25W8Ea25vae6qMrggATyDZ8Lhx43IzINYvJGt1LZAB2mQ8TbM7yT6SN7i TszA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s28-20020a63525c000000b00577fc59373fsi7660472pgl.296.2023.09.18.05.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:25:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 7686C81DAAD5; Mon, 18 Sep 2023 05:25:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241955AbjIRMYu (ORCPT + 99 others); Mon, 18 Sep 2023 08:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242000AbjIRMYf (ORCPT ); Mon, 18 Sep 2023 08:24:35 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B88B106; Mon, 18 Sep 2023 05:24:25 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,156,1688396400"; d="scan'208";a="176397781" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 18 Sep 2023 21:24:25 +0900 Received: from localhost.localdomain (unknown [10.226.92.107]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 3569641F6AEF; Mon, 18 Sep 2023 21:24:21 +0900 (JST) From: Biju Das To: Thomas Gleixner , Marc Zyngier Cc: Biju Das , Lad Prabhakar , Claudiu Beznea , Geert Uytterhoeven , Biju Das , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH 2/3] irqchip: renesas-rzg2l: Mask interrupts for changing interrupt settings Date: Mon, 18 Sep 2023 13:24:10 +0100 Message-Id: <20230918122411.237635-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230918122411.237635-1-biju.das.jz@bp.renesas.com> References: <20230918122411.237635-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 05:25:19 -0700 (PDT) As per RZ/G2L hardware manual Rev.1.30 section 8.8.3 Precaution when changing interrupt settings, we need to mask the interrupts for any changes in below settings: * When changing the noise filter settings. * When switching the GPIO pins to IRQ or GPIOINT. * When changing the source of TINT. * When changing the interrupt detection method. This patch masks the interrupts when there is a change in the interrupt detection method and changing the source of TINT. Fixes: 3fed09559cd8 ("irqchip: Add RZ/G2L IA55 Interrupt Controller driver") Signed-off-by: Biju Das Tested-by: Claudiu Beznea --- drivers/irqchip/irq-renesas-rzg2l.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-renesas-rzg2l.c index 2cee5477be6b..33a22bafedcd 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -116,11 +116,13 @@ static void rzg2l_irqc_irq_disable(struct irq_data *d) u8 tssr_index = TSSR_INDEX(offset); u32 reg; + irq_chip_mask_parent(d); raw_spin_lock(&priv->lock); reg = readl_relaxed(priv->base + TSSR(tssr_index)); reg &= ~(TSSEL_MASK << TSSEL_SHIFT(tssr_offset)); writel_relaxed(reg, priv->base + TSSR(tssr_index)); raw_spin_unlock(&priv->lock); + irq_chip_unmask_parent(d); } irq_chip_disable_parent(d); } @@ -137,11 +139,13 @@ static void rzg2l_irqc_irq_enable(struct irq_data *d) u8 tssr_index = TSSR_INDEX(offset); u32 reg; + irq_chip_mask_parent(d); raw_spin_lock(&priv->lock); reg = readl_relaxed(priv->base + TSSR(tssr_index)); reg |= (TIEN | tint) << TSSEL_SHIFT(tssr_offset); writel_relaxed(reg, priv->base + TSSR(tssr_index)); raw_spin_unlock(&priv->lock); + irq_chip_unmask_parent(d); } irq_chip_enable_parent(d); } @@ -226,10 +230,12 @@ static int rzg2l_irqc_set_type(struct irq_data *d, unsigned int type) unsigned int hw_irq = irqd_to_hwirq(d); int ret = -EINVAL; + irq_chip_mask_parent(d); if (hw_irq >= IRQC_IRQ_START && hw_irq <= IRQC_IRQ_COUNT) ret = rzg2l_irq_set_type(d, type); else if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) ret = rzg2l_tint_set_edge(d, type); + irq_chip_unmask_parent(d); if (ret) return ret; -- 2.25.1