Skip to content

Commit 52f0d86

Browse files
dramforeverThomas Gleixner
authored andcommitted
PCI/MSI: Check the device specific address mask in msi_verify_entries()
Instead of a 32-bit/64-bit dichotomy, check the MSI address against the device specific address mask. This allows platforms with an MSI doorbell address above the 32-bit limit to work with devices without full 64-bit MSI address support, as long as the doorbell is within the addressable range of the device. [ tglx: Massaged changelog ] Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260129-pci-msi-addr-mask-v4-2-70da998f2750@iscas.ac.cn
1 parent 386ced1 commit 52f0d86

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/pci/msi/msi.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,16 @@ static int msi_setup_msi_desc(struct pci_dev *dev, int nvec,
321321
static int msi_verify_entries(struct pci_dev *dev)
322322
{
323323
struct msi_desc *entry;
324+
u64 address;
324325

325326
if (dev->msi_addr_mask == DMA_BIT_MASK(64))
326327
return 0;
327328

328329
msi_for_each_desc(entry, &dev->dev, MSI_DESC_ALL) {
329-
if (entry->msg.address_hi) {
330-
pci_err(dev, "arch assigned 64-bit MSI address %#x%08x but device only supports 32 bits\n",
331-
entry->msg.address_hi, entry->msg.address_lo);
330+
address = (u64)entry->msg.address_hi << 32 | entry->msg.address_lo;
331+
if (address & ~dev->msi_addr_mask) {
332+
pci_err(dev, "arch assigned 64-bit MSI address %#llx above device MSI address mask %#llx\n",
333+
address, dev->msi_addr_mask);
332334
break;
333335
}
334336
}

0 commit comments

Comments
 (0)