From: Thomas Gleixner <tglx@kernel.org>
To: Biju <biju.das.au@gmail.com>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Biju Das <biju.das.au@gmail.com>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v5 15/15] irqchip/renesas-rzg2l: Add shared interrupt support
Date: Fri, 20 Mar 2026 10:00:30 +0100 [thread overview]
Message-ID: <87fr5ulvtd.ffs@tglx> (raw)
In-Reply-To: <20260311192459.609064-16-biju.das.jz@bp.renesas.com>
On Wed, Mar 11 2026 at 19:24, Biju wrote:
> +static int rzg2l_irqc_irq_request_resources(struct irq_data *d)
> +{
> + unsigned int hw_irq = irqd_to_hwirq(d);
> + struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
> + u32 offset, tssr_offset;
> + u8 tssr_index, tssel_shift;
> + u32 reg, inttsel_reg;
> + u8 value;
Once again: Proper variable declaration ordering please. Do I have to
repeat that every other week?
Again the same type salad.
> + if (!priv->info.shared_irq_cnt)
> + return 0;
> +
> + if (rzg2l_irqc_is_shared_irqc(priv->info, hw_irq)) {
> + offset = hw_irq + IRQC_TINT_COUNT - priv->info.tint_start;
> + tssr_offset = TSSR_OFFSET(offset);
> + tssr_index = TSSR_INDEX(offset);
> + tssel_shift = TSSEL_SHIFT(tssr_offset);
> +
> + reg = readl_relaxed(priv->base + TSSR(tssr_index));
> + value = (reg & (TIEN << tssel_shift)) >> tssel_shift;
> + if (value)
> + goto err_conflict;
> +
> + raw_spin_lock(&priv->lock);
scoped_guard()
> + inttsel_reg = readl_relaxed(priv->base + INTTSEL);
> + inttsel_reg |= TINTSEL(offset);
> + writel_relaxed(inttsel_reg, priv->base + INTTSEL);
> + raw_spin_unlock(&priv->lock);
> + } else if (rzg2l_irqc_is_shared_tint(priv->info, hw_irq)) {
> + offset = hw_irq - priv->info.tint_start;
> + tssr_offset = TSSR_OFFSET(offset);
> + tssr_index = TSSR_INDEX(offset);
> +
> + inttsel_reg = readl_relaxed(priv->base + INTTSEL);
> + value = (inttsel_reg & TINTSEL(offset)) >> offset;
> + if (value)
> + goto err_conflict;
> + }
> +
> + return 0;
> +
> +err_conflict:
> + pr_err("%s: Shared SPI conflict!\n", __func__);
> + return -EBUSY;
> +}
> +
> +static void rzg2l_irqc_irq_release_resources(struct irq_data *d)
> +{
> + unsigned int hw_irq = irqd_to_hwirq(d);
> + struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
> + u32 offset;
> + u8 inttsel_reg;
Your type choices are really interresting and both variables are not
used in the outer scope. Declare them in the scope where they are used.
> + if (!priv->info.shared_irq_cnt)
> + return;
> +
> + if (rzg2l_irqc_is_shared_irqc(priv->info, hw_irq)) {
> + offset = hw_irq + IRQC_TINT_COUNT - priv->info.tint_start;
> +
> + raw_spin_lock(&priv->lock);
> + inttsel_reg = readl_relaxed(priv->base + INTTSEL);
^^^^ ^^^
u8 u32
Seriously?
> + inttsel_reg &= ~TINTSEL(offset);
> + writel_relaxed(inttsel_reg, priv->base + INTTSEL);
> + raw_spin_unlock(&priv->lock);
Thanks,
tglx
next prev parent reply other threads:[~2026-03-20 9:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 19:24 [PATCH v5 00/15] Add RZ/G3L IRQC support Biju
2026-03-11 19:24 ` [PATCH v5 01/15] dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Use pattern for interrupt-names Biju
2026-03-11 19:24 ` [PATCH v5 02/15] dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Document RZ/G3L SoC Biju
2026-03-14 0:06 ` Rob Herring (Arm)
2026-03-11 19:24 ` [PATCH v5 03/15] irqchip/renesas-rzg2l: Drop redundant IRQC_TINT_START check in rzg2l_irqc_alloc() Biju
2026-03-11 19:24 ` [PATCH v5 04/15] irqchip/renesas-rzg2l: Replace single irq_chip with per-region irq_chip instances Biju
2026-03-11 19:24 ` [PATCH v5 05/15] irqchip/renesas-rzg2l: Split EOI handler into separate IRQ and TINT functions Biju
2026-03-20 8:42 ` Thomas Gleixner
2026-03-20 15:51 ` Biju Das
2026-03-11 19:24 ` [PATCH v5 06/15] irqchip/renesas-rzg2l: Split set_type " Biju
2026-03-11 19:24 ` [PATCH v5 07/15] irqchip/renesas-rzg2l: Replace rzg2l_irqc_irq_{enable,disable} with TINT-specific handlers Biju
2026-03-20 8:48 ` Thomas Gleixner
2026-03-20 16:02 ` Biju Das
2026-03-11 19:24 ` [PATCH v5 08/15] irqchip/renesas-rzg2l: Split rzfive_tint_irq_endisable() into separate IRQ and TINT helpers Biju
2026-03-20 8:50 ` Thomas Gleixner
2026-03-20 16:03 ` Biju Das
2026-03-11 19:24 ` [PATCH v5 09/15] irqchip/renesas-rzg2l: Split rzfive_irqc_{mask,unmask} into separate IRQ and TINT handlers Biju
2026-03-11 19:24 ` [PATCH v5 10/15] irqchip/renesas-rzg2l: Dynamically allocate fwspec array Biju
2026-03-11 19:24 ` [PATCH v5 11/15] irqchip/renesas-rzg2l: Drop IRQC_NUM_IRQ macro Biju
2026-03-11 19:24 ` [PATCH v5 12/15] irqchip/renesas-rzg2l: Drop IRQC_TINT_START macro Biju
2026-03-11 19:24 ` [PATCH v5 13/15] irqchip/renesas-rzg2l: Drop IRQC_IRQ_COUNT macro Biju
2026-03-11 19:24 ` [PATCH v5 14/15] irqchip/renesas-rzg2l: Add RZ/G3L support Biju
2026-03-11 19:24 ` [PATCH v5 15/15] irqchip/renesas-rzg2l: Add shared interrupt support Biju
2026-03-20 9:00 ` Thomas Gleixner [this message]
2026-03-20 16:07 ` Biju Das
2026-03-21 12:13 ` Biju Das
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=87fr5ulvtd.ffs@tglx \
--to=tglx@kernel.org \
--cc=biju.das.au@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox