diff options
-rw-r--r-- | drivers/pci/quirks.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 757186390d83..cf3e7c0ded3f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1644,19 +1644,23 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_ | |||
1644 | * return 1 if a HT MSI capability is found and enabled */ | 1644 | * return 1 if a HT MSI capability is found and enabled */ |
1645 | static int __devinit msi_ht_cap_enabled(struct pci_dev *dev) | 1645 | static int __devinit msi_ht_cap_enabled(struct pci_dev *dev) |
1646 | { | 1646 | { |
1647 | u8 pos; | 1647 | int pos, ttl = 48; |
1648 | int ttl; | 1648 | |
1649 | for (pos = pci_find_capability(dev, PCI_CAP_ID_HT), ttl = 48; | 1649 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); |
1650 | pos && ttl; | 1650 | while (pos && ttl--) { |
1651 | pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_HT), ttl--) { | 1651 | u8 flags; |
1652 | u32 cap_hdr; | 1652 | |
1653 | /* MSI mapping section according to Hypertransport spec */ | 1653 | if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, |
1654 | if (pci_read_config_dword(dev, pos, &cap_hdr) == 0 | 1654 | &flags) == 0) |
1655 | && (cap_hdr & 0xf8000000) == 0xa8000000 /* MSI mapping */) { | 1655 | { |
1656 | printk(KERN_INFO "PCI: Found HT MSI mapping on %s with capability %s\n", | 1656 | printk(KERN_INFO "PCI: Found %s HT MSI Mapping on %s\n", |
1657 | pci_name(dev), cap_hdr & 0x10000 ? "enabled" : "disabled"); | 1657 | flags & HT_MSI_FLAGS_ENABLE ? |
1658 | return (cap_hdr & 0x10000) != 0; /* MSI mapping cap enabled */ | 1658 | "enabled" : "disabled", pci_name(dev)); |
1659 | return (flags & HT_MSI_FLAGS_ENABLE) != 0; | ||
1659 | } | 1660 | } |
1661 | |||
1662 | pos = pci_find_next_ht_capability(dev, pos, | ||
1663 | HT_CAPTYPE_MSI_MAPPING); | ||
1660 | } | 1664 | } |
1661 | return 0; | 1665 | return 0; |
1662 | } | 1666 | } |