> Gesendet: Montag, 02. November 2020 um 14:58 Uhr > Von: "Marc Zyngier" <maz@xxxxxxxxxx> > diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c > index d15c881e2e7e..5bb1306162c7 100644 > --- a/drivers/pci/pci-sysfs.c > +++ b/drivers/pci/pci-sysfs.c > @@ -387,10 +387,20 @@ static ssize_t msi_bus_store(struct device *dev, > struct device_attribute *attr, > return count; > } > > - if (val) > + if (val) { > + /* > + * If there is no possibility for this bus to deal with > + * MSIs, then allowing them to be requested would lead to > + * the kernel complaining loudly. In this situation, don't > + * let userspace mess things up. > + */ > + if (!pci_bus_is_msi_capable(subordinate)) > + return -EINVAL; > + > subordinate->bus_flags &= ~PCI_BUS_FLAGS_NO_MSI; > - else > + } else { > subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; > + } > > dev_info(&subordinate->dev, "MSI/MSI-X %s for future drivers of > devices on this bus\n", > val ? "allowed" : "disallowed"); > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index 4289030b0fff..28861cc6435a 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -871,6 +871,8 @@ static void pci_set_bus_msi_domain(struct pci_bus > *bus) > d = pci_host_bridge_msi_domain(b); > > dev_set_msi_domain(&bus->dev, d); > + if (!pci_bus_is_msi_capable(bus)) > + bus->bus_flags |= PCI_BUS_FLAGS_NO_MSI; > } > > static int pci_register_host_bridge(struct pci_host_bridge *bridge) > diff --git a/include/linux/pci.h b/include/linux/pci.h > index 22207a79762c..6aadb863dff4 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -2333,6 +2333,12 @@ pci_host_bridge_acpi_msi_domain(struct pci_bus > *bus) { return NULL; } > static inline bool pci_pr3_present(struct pci_dev *pdev) { return > false; } > #endif > > +static inline bool pci_bus_is_msi_capable(struct pci_bus *bus) > +{ > + return (IS_ENABLED(CONFIG_PCI_MSI_ARCH_FALLBACKS) || > + dev_get_msi_domain(&bus->dev)); > +} > + > #ifdef CONFIG_EEH > static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) > { Hi, this Patch seems to work well too...no warning, pcie-card and hdd recognized regards Frank