[PATCH] PCI: make MSI quirk inheritable from the pci bus

It turns out AMD 8131 quirk only affects MSI for devices behind the 8131 bridge.
Handle this by adding a flags field in pci_bus, inherited from parent to child.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Michael S. Tsirkin 2006-02-14 18:52:22 +02:00 • committed by Greg Kroah-Hartman
commit 6e325a62a0
4 changed files with 15 additions and 3 deletions

View file

@ -703,6 +703,9 @@ int pci_enable_msi(struct pci_dev* dev)
if (dev->no_msi)
return status;
if (dev->bus->bus_flags & PCI_BUS_FLAGS_NO_MSI)
return -EINVAL;
temp = dev->irq;
status = msi_init();

View file

@ -347,6 +347,7 @@ pci_alloc_child_bus(struct pci_bus *parent, struct pci_dev *bridge, int busnr)
child->parent = parent;
child->ops = parent->ops;
child->sysdata = parent->sysdata;
child->bus_flags = parent->bus_flags;
child->bridge = get_device(&bridge->dev);
child->class_dev.class = &pcibus_class;

View file

@ -575,8 +575,11 @@ static void __init quirk_amd_8131_ioapic(struct pci_dev *dev)
{
unsigned char revid, tmp;
pci_msi_quirk = 1;
printk(KERN_WARNING "PCI: MSI quirk detected. pci_msi_quirk set.\n");
if (dev->subordinate) {
printk(KERN_WARNING "PCI: MSI quirk detected. "
"PCI_BUS_FLAGS_NO_MSI set for subordinate bus.\n");
dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
}
if (nr_ioapics == 0)
return;