All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Claudiu Beznea" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] irqchip/renesas-rzg2l: Implement restriction when writing ISCR register
Date: Tue, 12 Dec 2023 14:44:23 -0000	[thread overview]
Message-ID: <170239226360.398.4471792176265602283.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20231120111820.87398-6-claudiu.beznea.uj@bp.renesas.com>

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     ef88eefb1a81a8701eabb7d5ced761a66a465a49
Gitweb:        https://git.kernel.org/tip/ef88eefb1a81a8701eabb7d5ced761a66a465a49
Author:        Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
AuthorDate:    Mon, 20 Nov 2023 13:18:16 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 12 Dec 2023 15:40:41 +01:00

irqchip/renesas-rzg2l: Implement restriction when writing ISCR register

The RZ/G2L manual (chapter "IRQ Status Control Register (ISCR)") describes
the operation to clear interrupts through the ISCR register as follows:

[Write operation]

  When "Falling-edge detection", "Rising-edge detection" or
  "Falling/Rising-edge detection" is set in IITSR:

    - 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 "Low-level detection" is set in IITSR.:
        Invalid to write.

Take the interrupt type into account when clearing interrupts through the
ISCR register to avoid writing the ISCR when the interrupt type is level.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231120111820.87398-6-claudiu.beznea.uj@bp.renesas.com

---
 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-renesas-rzg2l.c
index 0a77927..d450417 100644
--- a/drivers/irqchip/irq-renesas-rzg2l.c
+++ b/drivers/irqchip/irq-renesas-rzg2l.c
@@ -78,11 +78,17 @@ static void rzg2l_irq_eoi(struct irq_data *d)
 	unsigned int hw_irq = irqd_to_hwirq(d) - IRQC_IRQ_START;
 	struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
 	u32 bit = BIT(hw_irq);
-	u32 reg;
+	u32 iitsr, iscr;
 
-	reg = readl_relaxed(priv->base + ISCR);
-	if (reg & bit)
-		writel_relaxed(reg & ~bit, priv->base + ISCR);
+	iscr = readl_relaxed(priv->base + ISCR);
+	iitsr = readl_relaxed(priv->base + IITSR);
+
+	/*
+	 * ISCR can only be cleared if the type is falling-edge, rising-edge or
+	 * falling/rising-edge.
+	 */
+	if ((iscr & bit) && (iitsr & IITSR_IITSEL_MASK(hw_irq)))
+		writel_relaxed(iscr & ~bit, priv->base + ISCR);
 }
 
 static void rzg2l_tint_eoi(struct irq_data *d)

  parent reply	other threads:[~2023-12-12 14:44 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 11:18 [PATCH v3 0/9] irqchip/renesas-rzg2l: add support for RZ/G3S SoC Claudiu
2023-11-20 11:18 ` [PATCH v3 1/9] clk: renesas: r9a08g045: Add IA55 pclk and its reset Claudiu
2023-11-21  9:59   ` Geert Uytterhoeven
2023-11-21 11:03     ` claudiu beznea
2023-12-13 14:11     ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-09 16:22     ` Geert Uytterhoeven
2023-11-20 11:18 ` [PATCH v3 2/9] irqchip/renesas-rzg2l: Use tabs instead of spaces Claudiu
2023-11-21 10:07   ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea
2023-11-20 11:18 ` [PATCH v3 3/9] irqchip/renesas-rzg2l: Align struct member names to tabs Claudiu
2023-11-21 10:09   ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea
2023-11-20 11:18 ` [PATCH v3 4/9] irqchip/renesas-rzg2l: Document structure members Claudiu
2023-11-21 10:10   ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea
2023-11-20 11:18 ` [PATCH v3 5/9] irqchip/renesas-rzg2l: Implement restriction when writing ISCR register Claudiu
2023-11-21 10:17   ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea [this message]
2023-11-20 11:18 ` [PATCH v3 6/9] irqchip/renesas-rzg2l: Add macro to retrieve TITSR register offset based on register's index Claudiu
2023-11-21 10:30   ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea
2023-11-20 11:18 ` [PATCH v3 7/9] irqchip/renesas-rzg2l: Add support for suspend to RAM Claudiu
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea
2023-11-20 11:18 ` [PATCH v3 8/9] dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Document RZ/G3S Claudiu
2023-11-21 10:44   ` Geert Uytterhoeven
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-12 14:44   ` tip-bot2 for Claudiu Beznea
2023-11-20 11:18 ` [PATCH v3 9/9] arm64: dts: renesas: r9108g045: Add IA55 interrupt controller node Claudiu
2023-12-08 21:14   ` [tip: irq/core] " tip-bot2 for Claudiu Beznea
2023-12-09 16:24     ` Geert Uytterhoeven
2023-12-12 14:41       ` Thomas Gleixner
2023-12-13 14:18   ` [PATCH v3 9/9] " Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170239226360.398.4471792176265602283.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.