mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI/MSI: Skip address mask check for MSI-X entries
@ 2026-11-09  9:24 Yu Yang via B4 Relay
  2026-11-09 13:52 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Yu Yang via B4 Relay @ 2026-11-09  9:24 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, Thomas Gleixner, Michael Ellerman, Brett Creeley,
	Shannon Nelson, linux-kernel, Yu Yang

From: Yu Yang <yuyang@kylinos.cn>

The AHCI controller on Zhaoxin ZX-200 platforms supports only 32-bit
MSI addresses, but its MSI-X capability uses 64-bit message addresses.
pci_msi_init() therefore sets dev->msi_addr_mask to DMA_BIT_MASK(32)
based on the MSI capability.

msi_verify_entries() is shared between the MSI and MSI-X setup paths.
When the irq domain assigns an MSI-X message address above 4GB, the
32-bit mask inherited from the MSI capability causes MSI-X setup to
fail with -EIO:

  ahci 0000:09:0f.0: arch assigned 64-bit MSI address 0x8002a030040
  above device MSI address mask 0xffffffff.
  ...
  ahci: probe of 0000:09:0f.0 failed with error -22.

MSI-X table entries have a 64-bit message address field, so the 32-bit
limit derived from the MSI capability does not apply to them.
Platforms that use msi_addr_mask to constrain MSI-X allocation, e.g.
powerpc pseries/powernv and ionic on PPC64, already allocate addresses
that satisfy the mask, so the verification is redundant for MSI-X.

Skip the address mask check for MSI-X descriptors.

Fixes: f144d1496b47 ("PCI/MSI: Add device flag indicating that 64-bit MSIs don't work")

Signed-off-by: Yu Yang <yuyang@kylinos.cn>
---
 drivers/pci/msi/msi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index 8a0133a6a286..7f34bccc8248 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -338,6 +338,13 @@ static int msi_verify_entries(struct pci_dev *dev)
 		return 0;
 
 	msi_for_each_desc(entry, &dev->dev, MSI_DESC_ALL) {
+		/*
+		 * MSI-X entries always use a 64-bit address, so the address
+		 * limit for MSI capability does not apply for MSI-X.
+		 */
+		if (entry->pci.msi_attrib.is_msix)
+			continue;
+
 		address = (u64)entry->msg.address_hi << 32 | entry->msg.address_lo;
 		if (address & ~dev->msi_addr_mask) {
 			pci_err(dev, "arch assigned 64-bit MSI address %#llx above device MSI address mask %#llx\n",

---
base-commit: 996a59519af2ef3d8f47479685616bb2278c6cfa
change-id: 20261109-pci-fix-msix-alloc-failure-cdffedf97e82

Best regards,
-- 
Yu Yang <yuyang@kylinos.cn>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-09 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09  9:24 [PATCH] PCI/MSI: Skip address mask check for MSI-X entries Yu Yang via B4 Relay
2026-11-09 13:52 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®