All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Claudiu Beznea" <claudiu.beznea@kernel.org>
Cc: linux-pci@vger.kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH 4/6] PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are masked
Date: Thu, 03 Dec 2026 10:47:39 +0000	[thread overview]
Message-ID: <sashiko-outbox-247609@kernel.org> (raw)
In-Reply-To: <20261203093224.247349-5-claudiu.beznea@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] PCI: rzg3s-host: rzg3s_pcie_irq_init() fails to mask INTx and
  MSI sources
--

commit 235fc1f6b07ca2eb04e5a0e74470c01037910a31
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are masked

This commit moves init_irqdomain() from rzg3s_pcie_host_setup() into
rzg3s_pcie_host_init() after rzg3s_pcie_irq_init(), and updates the
error-handling teardown order accordingly.

> diff --git a/drivers/pci/controller/pcie-rzg3s-host.c b/drivers/pci/controller/pcie-rzg3s-host.c
> index 201888f1f5250..cbe25615eb967 100644
> --- a/drivers/pci/controller/pcie-rzg3s-host.c
> +++ b/drivers/pci/controller/pcie-rzg3s-host.c

[ ... ]

> @@ -1441,10 +1444,14 @@ static int rzg3s_pcie_host_init(struct rzg3s_pcie_host *host)
>  	/* Initialize the interrupts */
>  	rzg3s_pcie_irq_init(host);
>  
> +	ret = init_irqdomain(host);
> +	if (ret)
> +		goto config_deinit_and_refclk;

[Severity: Medium]
Does rzg3s_pcie_irq_init() actually mask the INTx and MSI sources whose
handlers init_irqdomain() installs?

rzg3s_pcie_irq_init() only clears and disables the PCIe event and error
registers (PEIE0/1, PEIS0/1, AMEIS, ASEIS1, MSGRCVIS).  It leaves the
INTx and MSI registers (RZG3S_PCI_PINTRCVIE, RZG3S_PCI_PINTRCVIS,
RZG3S_PCI_MSGRCVIE, MSIRE/MSIRM/MSIRS, RZG3S_PCI_MSIRCVWADRL) untouched.

Since power_resets are shared and only deasserted on probe without being
asserted first, bootloader or prior controller state in those registers
persists across rzg3s_pcie_irq_init().

If a level-triggered INTx is latched when irq_set_chained_handler_and_data()
runs before any child virq is mapped, generic_handle_domain_irq() returns
-EINVAL without acking or masking the line, causing an infinite
chained-IRQ storm.

Similarly, rzg3s_pcie_init_msi() calls request_irq() before
rzg3s_pcie_msi_setup(), so a left-enabled MSI can still fire on
half-initialized state.

Masking and clearing the INTx and MSI registers in rzg3s_pcie_irq_init()
(with a readback barrier after the writel_relaxed() writes) before
init_irqdomain() would ensure the handlers are installed safely.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203093224.247349-1-claudiu.beznea@kernel.org?part=4

  reply	other threads:[~2026-12-03 10:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  9:32 [PATCH 0/6] PCI: rzg3s-host: Fixes Claudiu Beznea
2026-12-03  9:32 ` [PATCH 1/6] PCI: rzg3s-host: Follow hardware manual clock/reset initialization order Claudiu Beznea
2026-12-03  9:51   ` sashiko-bot
2026-12-03  9:32 ` [PATCH 2/6] PCI: rzg3s-host: Fix runtime PM handling in the NOIRQ suspend/resume phase Claudiu Beznea
2026-12-03 10:10   ` sashiko-bot
2026-12-03  9:32 ` [PATCH 3/6] PCI: rzg3s-host: Create the INTx IRQ domain before setting the chained handlers Claudiu Beznea
2026-12-03 10:27   ` sashiko-bot
2026-12-03  9:32 ` [PATCH 4/6] PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are masked Claudiu Beznea
2026-12-03 10:47   ` sashiko-bot [this message]
2026-12-03  9:32 ` [PATCH 5/6] PCI: rzg3s-host: Drop read-modify-write approach for the R/W1C registers Claudiu Beznea
2026-12-03 10:57   ` sashiko-bot
2026-12-03  9:32 ` [PATCH 6/6] PCI: rzg3s-host: Fix NVMe resume errors after s2idle Claudiu Beznea
2026-12-03  9:44   ` Wolfram Sang
2026-12-03  9:55     ` Claudiu Beznea
2026-12-03 10:32       ` Wolfram Sang
2026-12-03 11:11   ` sashiko-bot

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=sashiko-outbox-247609@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=claudiu.beznea@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.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 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.