From: Inochi Amaoto <inochiama@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Marc Zyngier <maz@kernel.org>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Inochi Amaoto <inochiama@gmail.com>,
Shradha Gupta <shradhagupta@linux.microsoft.com>,
Chen Wang <unicorn_wang@outlook.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Linux Kernel Functional Testing <lkft@linaro.org>,
Nathan Chancellor <nathan@kernel.org>,
Wei Fang <wei.fang@nxp.com>, Jon Hunter <jonathanh@nvidia.com>
Subject: [PATCH] PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()
Date: Thu, 28 Aug 2025 07:03:53 +0800 [thread overview]
Message-ID: <20250827230354.16249-1-inochiama@gmail.com> (raw)
For msi controller that only supports MSI_FLAG_PCI_MSI_MASK_PARENT,
the newly added callback irq_startup() and irq_shutdown() for
pci_msi[x]_tamplete will not unmask/mask the interrupt when startup/
shutdown the interrupt. This will prevent the interrupt from being
enabled/disabled normally.
Add the missing check for MSI_FLAG_PCI_MSI_MASK_PARENT in the
cond_[startup|shutdown]_parent(). So the interrupt can be normally
unmasked/masked if it does not support MSI_FLAG_PCI_MSI_MASK_PARENT.
Fixes: 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/regressions/aK4O7Hl8NCVEMznB@monster/
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/regressions/20250826220959.GA4119563@ax162/
Reported-by: Wei Fang <wei.fang@nxp.com>
Closes: https://lore.kernel.org/all/20250827093911.1218640-1-wei.fang@nxp.com/
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
Change from v1:
- https://lore.kernel.org/all/20250827062911.203106-1-inochiama@gmail.com/
1. Apply Tested-by, Reported-by and Tested-by from original post [1].
2. update mistake in the comments.
[1] https://lore.kernel.org/regressions/aK4O7Hl8NCVEMznB@monster/
---
drivers/pci/msi/irqdomain.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
index 50ccac32f4cf..cbdc83c064d4 100644
--- a/drivers/pci/msi/irqdomain.c
+++ b/drivers/pci/msi/irqdomain.c
@@ -154,6 +154,8 @@ static void cond_shutdown_parent(struct irq_data *data)
if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
irq_chip_shutdown_parent(data);
+ else if (unlikely(info->flags & MSI_FLAG_PCI_MSI_MASK_PARENT))
+ irq_chip_mask_parent(data);
}
static unsigned int cond_startup_parent(struct irq_data *data)
@@ -162,6 +164,9 @@ static unsigned int cond_startup_parent(struct irq_data *data)
if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
return irq_chip_startup_parent(data);
+ else if (unlikely(info->flags & MSI_FLAG_PCI_MSI_MASK_PARENT))
+ irq_chip_unmask_parent(data);
+
return 0;
}
--
2.51.0
next reply other threads:[~2025-08-27 23:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 23:03 Inochi Amaoto [this message]
2025-08-27 23:07 ` [PATCH] PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent() Inochi Amaoto
-- strict thread matches above, loose matches on Subject: below --
2025-08-27 6:29 Inochi Amaoto
2025-08-27 10:04 ` Jon Hunter
2025-08-27 18:32 ` Bjorn Helgaas
2025-08-27 22:52 ` Inochi Amaoto
2025-08-27 22:58 ` Bjorn Helgaas
2025-08-29 7:41 ` Naresh Kamboju
2025-09-01 12:35 ` Mark Brown
2025-09-01 15:24 ` Bjorn Helgaas
2025-09-01 15:26 ` Bjorn Helgaas
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=20250827230354.16249-1-inochiama@gmail.com \
--to=inochiama@gmail.com \
--cc=bhelgaas@google.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lkft@linaro.org \
--cc=lpieralisi@kernel.org \
--cc=maz@kernel.org \
--cc=nathan@kernel.org \
--cc=shradhagupta@linux.microsoft.com \
--cc=tglx@linutronix.de \
--cc=unicorn_wang@outlook.com \
--cc=wei.fang@nxp.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.