]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask
authorVivian Wang <wangruikang@iscas.ac.cn>
Thu, 29 Jan 2026 01:56:06 +0000 (09:56 +0800)
committerThomas Gleixner <tglx@kernel.org>
Sat, 31 Jan 2026 00:11:48 +0000 (01:11 +0100)
commit386ced19e9a348e8131d20f009e692fa8fcc4568
tree07e95b5949b774feba691dae8d8408ecb9aab05f
parent37f9d5026cd78fbe80a124edbbadab382b26545f
PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask

Some PCI devices have PCI_MSI_FLAGS_64BIT in the MSI capability, but
implement less than 64 address bits. This breaks on platforms where such
a device is assigned an MSI address higher than what's supported.

Currently, no_64bit_msi bit is set for these devices, meaning that only
32-bit MSI addresses are allowed for them. However, on some platforms the
MSI doorbell address is above the 32-bit limit but within the addressable
range of the device.

As a first step to enable MSI on those combinations of devices and
platforms, convert the boolean no_64bit_msi flag to a DMA mask and fixup
the affected usage sites:

  - no_64bit_msi = 1    ->    msi_addr_mask = DMA_BIT_MASK(32)
  - no_64bit_msi = 0    ->    msi_addr_mask = DMA_BIT_MASK(64)
  - if (no_64bit_msi)   ->    if (msi_addr_mask < DMA_BIT_MASK(64))

Since no values other than DMA_BIT_MASK(32) and DMA_BIT_MASK(64) are used,
this is functionally equivalent.

This prepares for changing the binary decision between 32 and 64 bit to a
DMA mask based decision which allows to support systems which have a DMA
address space less than 64bit but a MSI doorbell address above the 32-bit
limit.

[ tglx: Massaged changelog ]

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Brett Creeley <brett.creeley@amd.com> # ionic
Reviewed-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de> # sound
Link: https://patch.msgid.link/20260129-pci-msi-addr-mask-v4-1-70da998f2750@iscas.ac.cn
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/pseries/msi.c
drivers/gpu/drm/radeon/radeon_irq_kms.c
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
drivers/pci/msi/msi.c
drivers/pci/msi/pcidev_msi.c
drivers/pci/probe.c
include/linux/pci.h
sound/hda/controllers/intel.c