Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1336713rdh; Fri, 27 Oct 2023 11:02:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeHpJa3JhWpIPGaUkTOMlhuqDnr3rDOkiB8EMgKvbxA4N3ESt23POHlNwwfJVkKSMMD9BF X-Received: by 2002:a81:ac46:0:b0:5a7:c8a9:79e8 with SMTP id z6-20020a81ac46000000b005a7c8a979e8mr3467979ywj.4.1698429774968; Fri, 27 Oct 2023 11:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698429774; cv=none; d=google.com; s=arc-20160816; b=j1DMwgtmYrh61SCv2W5UrFcysbj2fN7MRVL8qdmCHSQC15lkQwqfrHIBEl53qtex7a 3d8gbjwk8WpozYA0tcR8wAIEPReOcr3OLKKzecGXz+lF6jNTDXF+cgNBFaeh+W26qOqN xSckcBOSW4CPTj2SZ5KtNVr8TejsEwjB2+D7I5VDfguluvp/yEQJZMQ3FHv+8Fti01PY Lpu/qj0xK2iuTTRY9NiPyTpXvnwqh6g34OaLZ42rntyHidllrd47YBDJyqfXgM5OLxdF IW1HF17G0AfemZNIpk+3L8KJ4c/qliLRGe2J9wdr33XAJX0KLdPCGKzJibq9LieMqBFv Dn0w== 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 :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=275/pEO9JSbT2rFQuOaMcx49ECFedNGNEcjTI6T5tHQ=; fh=nTUGOzatG2iDvc/1PN8lxEkbfUIvVxilWBm5WTH8Y1Q=; b=qmoorYsAVtoPbI97rrssXJUX/zNixH0yYKGxtY6/m0uSTHBtcmYJr3PATy5h+IYJAA Gu/O1wGaZZ/UlhAUe6/YtDav7IF9TxmNzWiCGYmwrGlrTKq1bqgFkEMw/3D05HMLLQwk NV5smBYPpR5YbYO9fCV9fiUiiP8bygaHWY++xoGE3P80LCu4ffhW0G+lVLythvJJ+GH1 8Y1WOmc7Nc5e3ajT8qg0NVXBr9ZAkLr9nhzaqmppeLz26GEplvAZUWpoGUlObATXQMAD +zufSmDQ++OC90Ar2F9YEyJwxfdsCh2xx11DBlOnyIY1DbGcb1r0uMYUTPtXzWFle1IY Th0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Cnym3aE/"; dkim=neutral (no key) header.i=@linutronix.de header.b="/Bh6SXcT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p68-20020a0dcd47000000b005a7ad46550asi3437434ywd.78.2023.10.27.11.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:02:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Cnym3aE/"; dkim=neutral (no key) header.i=@linutronix.de header.b="/Bh6SXcT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3A2C983251A6; Fri, 27 Oct 2023 11:02:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232237AbjJ0SCg (ORCPT + 99 others); Fri, 27 Oct 2023 14:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbjJ0SCe (ORCPT ); Fri, 27 Oct 2023 14:02:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F32F3; Fri, 27 Oct 2023 11:02:32 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698429751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=275/pEO9JSbT2rFQuOaMcx49ECFedNGNEcjTI6T5tHQ=; b=Cnym3aE/MF04lGmNEJ/rj7eiBbiNdk+shih3rRLBMz4VyD7Zf6m1qZDw33ZcSbXjM994/L n6Rk+EubSPDLkicm+IKTuemcD7T8eF0mb/zrxvI+QurSlI361oSl3j+xaEd6NM99jeC5B8 vMv4AuFABxjznTyXaVjxyUEe1ArpgGvLfaSMkxV6XDOPgKQq5x8woyBt3MSK8YJuynjHH9 8K2qLSMgNUeq97IGvbfvvb9fxKIOjlvJYPkka+EN7oiFdT16YioWtxK3lhrz55Id3XsN8+ zGmxT6zssPwUwkJaR3y/SKHilgsR0nI87zc6lfm32GtrGP9ssWa+b26zRKP71A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698429751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=275/pEO9JSbT2rFQuOaMcx49ECFedNGNEcjTI6T5tHQ=; b=/Bh6SXcTZYFvCff2EuZ0kRFjPMNMy5Z1grSfncXKCX8u1pJkSJwkiFCPhQ/sQo7G+WpZwX zz0lNb02UgKn53AQ== To: Claudiu , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: Re: [PATCH 4/7] irqchip/renesas-rzg2l: implement restriction when writing ISCR register In-Reply-To: <20231023102223.1309614-5-claudiu.beznea.uj@bp.renesas.com> References: <20231023102223.1309614-1-claudiu.beznea.uj@bp.renesas.com> <20231023102223.1309614-5-claudiu.beznea.uj@bp.renesas.com> Date: Fri, 27 Oct 2023 20:02:30 +0200 Message-ID: <878r7o2bbd.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:02:50 -0700 (PDT) On Mon, Oct 23 2023 at 13:22, Claudiu wrote: > In hardware manual of RZ/G2L (r01uh0914ej0130-rzg2l-rzg2lc.pdf) This filename is completely useless. > is available the following statement with regards to clearing > interrupts The RZ/G2L manual describes the operation to clear interrupts > though ISCR register: through the ISCR ... > > [Write operation] > When "Falling-edge detection", "Rising-edge detection" or > "Falling/Rising-edge detection" is set in ISCR.: > - In case ISTAT is 1 > 0: IRQn interrupt detection status is cleared. > 1: Invalid to write. > - In case ISTAT is 0 > Invalid to write. > When =E2=80=9CLow-level detection=E2=80=9D is set in IITSR.: > Invalid to write. > > Thus, take into account interrupt type when clearing interrupts though take the interrupt type into account... through the ISCR ... > ISCR register. > > Signed-off-by: Claudiu Beznea > --- > drivers/irqchip/irq-renesas-rzg2l.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-re= nesas-rzg2l.c > index 9ce0d6d67486..1ed9cb7178fa 100644 > --- a/drivers/irqchip/irq-renesas-rzg2l.c > +++ b/drivers/irqchip/irq-renesas-rzg2l.c > @@ -73,11 +73,17 @@ static void rzg2l_irq_eoi(struct irq_data *d) > unsigned int hw_irq =3D irqd_to_hwirq(d) - IRQC_IRQ_START; > struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); > u32 bit =3D BIT(hw_irq); > - u32 reg; > + u32 iitsr, iscr; >=20=20 > - reg =3D readl_relaxed(priv->base + ISCR); > - if (reg & bit) > - writel_relaxed(reg & ~bit, priv->base + ISCR); > + iscr =3D readl_relaxed(priv->base + ISCR); > + iitsr =3D readl_relaxed(priv->base + IITSR); > + > + /* > + * ISCR could be cleared only if type is falling-edge, rising-edge or ISCR can only be cleared if the type is ... > + * falling/rising-edge. > + */ > + if ((iscr & bit) && (iitsr & IITSR_IITSEL_MASK(hw_irq))) > + writel_relaxed(iscr & ~bit, priv->base + ISCR); > } >=20=20 > static void rzg2l_tint_eoi(struct irq_data *d)