diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 194af6517eb193d5e15ced1983ce93469882af0b..c9739a4480ef18272e72ae07eb52dd048f99fa5a 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -559,11 +559,11 @@ static int msi_verify_entries(struct pci_dev *dev) struct msi_desc *entry; for_each_new_pci_msi_entry(entry, dev) { - if (!dev->no_64bit_msi || !entry->msg.address_hi) - continue; - pci_err(dev, "Device has broken 64-bit MSI but arch" - " tried to assign one above 4G\n"); + if (entry->msg.address_hi && dev->no_64bit_msi) { + pci_err(dev, "arch assigned 64-bit MSI address %#x%08x but device only supports 32 bits\n", + entry->msg.address_hi, entry->msg.address_lo); return -EIO; + } } return 0; } diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 576fd48a1a3143a70e4777a0b601060960d9f346..645d97ed9020eb1184a3821b40b719fad9e3a248 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1722,6 +1722,8 @@ static u8 pci_hdr_type(struct pci_dev *dev) static void pci_msi_setup_pci_dev(struct pci_dev *dev) { + u16 ctrl; + /* * Disable the MSI hardware to avoid screaming interrupts * during boot. This is the power on reset default so @@ -1731,6 +1733,10 @@ static void pci_msi_setup_pci_dev(struct pci_dev *dev) if (dev->msi_cap) pci_msi_set_enable(dev, 0); + pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &ctrl); + if (!(ctrl & PCI_MSI_FLAGS_64BIT)) + dev->no_64bit_msi = 1; + dev->msix_cap = pci_find_capability(dev, PCI_CAP_ID_MSIX); if (dev->msix_cap) pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);