PCI/MSI: Size device MSI domain with the maximum number of vectors
authorMarc Zyngier <maz@kernel.org>
Tue, 3 Jun 2025 14:18:01 +0000 (15:18 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 4 Jun 2025 09:19:25 +0000 (11:19 +0200)
commit9cc82d99b13c1ad04e3dff9182b7953a8dba10b6
treed8f93912b5718e42377e323363cbe1794a7a0f8c
parent5abc7438f1e9d62e91ad775cc83c9594c48d2282
PCI/MSI: Size device MSI domain with the maximum number of vectors

Zenghui reports that since 1396e89e09f0 ("genirq/msi: Move prepare() call
to per-device allocation"), his Multi-MSI capable device isn't working
anymore.

This is a consequence of 15c72f824b32 ("PCI/MSI: Add support for per device
MSI[X] domains"), which always creates a MSI domain of size 1, even in the
presence of Multi-MSI.

While this was somehow working until then, moving the .prepare() call ends
up sizing the ITS table with a tiny value for this device, and making the
endpoint driver unhappy.

Instead, always create the domain and call the .prepare() helper with the
maximum expected size.

Fixes: 1396e89e09f0 ("genirq/msi: Move prepare() call to per-device allocation")
Fixes: 15c72f824b32 ("PCI/MSI: Add support for per device MSI[X] domains")
Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Link: https://lore.kernel.org/all/20250603141801.915305-1-maz@kernel.org
Closes: https://lore.kernel.org/r/0b1d7aec-1eac-a9cd-502a-339e216e08a1@huawei.com
drivers/pci/msi/irqdomain.c
drivers/pci/msi/msi.c
drivers/pci/msi/msi.h