From 84127c6bc63b058620f613c52266b264f96c7d44 Mon Sep 17 00:00:00 2001 From: Andy Gospodarek Date: Thu, 3 Apr 2008 15:20:35 -0400 Subject: [PATCH] pci: quirks for HT1000 RHBZ 439110 commit 6bae1d96c6d7dde078994f6cb98235fd46f8736b Author: Sebastien Dugue Date: Thu Dec 13 16:09:25 2007 -0800 PCI: quirk: enable MSI Mapping on HT1000 Add a quirk to enable the MSI mapping capability on HyperTransport bridges. commit 1d84b5424efbcce69a1c955ba181147d23d43a14 Author: David Miller Date: Thu Oct 25 01:15:53 2007 -0700 PCI: Add MSI quirk for ServerWorks HT1000 PCIX bridge. commit 2cc31879f8cfa0efc74fe7e58ab4e01ef5908730 Author: David Miller Date: Thu Oct 25 01:15:24 2007 -0700 PCI: Revert "PCI: disable MSI by default on systems with Serverworks HT1000 chips" --- drivers/pci/quirks.c | 28 +++++++++++++++++++++++++++- include/linux/pci_ids.h | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a2fce08..ca70481 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -1759,7 +1759,6 @@ static void __init quirk_disable_all_msi(struct pci_dev *dev) printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); @@ -1814,6 +1813,33 @@ static void __devinit quirk_msi_ht_cap(struct pci_dev *dev) DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE, quirk_msi_ht_cap); + +/* + * Force enable MSI mapping capability on HT bridges + */ +static void __devinit quirk_msi_ht_cap_enable(struct pci_dev *dev) +{ + int pos, ttl = 48; + + pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); + while (pos && ttl--) { + u8 flags; + + if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) { + printk(KERN_INFO "PCI: Enabling HT MSI Mapping on %s\n", + pci_name(dev)); + + pci_write_config_byte(dev, pos + HT_MSI_FLAGS, + flags | HT_MSI_FLAGS_ENABLE); + } + pos = pci_find_next_ht_capability(dev, pos, + HT_CAPTYPE_MSI_MAPPING); + } +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, + PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, + quirk_msi_ht_cap_enable); + /* The nVidia CK804 chipset may have 2 HT MSI mappings. * MSI are supported if the MSI capability set in any of these mappings. */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1a2ed93..a136c63 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1431,8 +1431,8 @@ #define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 +#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB 0x0036 #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 -#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX 0x0104 #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 -- 1.5.2.1