Skip to contentSkip to conversation

quirk: Enable MSI Mapping on HT1000

PATCH Eric W. Biederman 1 participant 1 message Nov 27, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric W. Biederman

author Acked-by
#1 lore raw
Quoted 7 lines · Sébastien Dugué

From: Sebastien Dugue <[email protected]>

Add a quirk to enable the MSI mapping capability on HyperTransport
bridges.

Wire Broadcom's HT1000 to use the quirk.

Quoted 7 lines

This patch applies cleanly on 2.6.24-rc3-mm1 and was tested on 2.6.24-rc3
(sorry, but 2.6.24-rc3-mm1 would not boot on my box).

I also have been running 2.6.21-rt10 with that patch for quite some
time now.

Sebastien.

Looks like a sane starting point, and if we know the chipset can do it preferable to disabling msi on that chipset.

Quoted 51 lines
Cc "Eric W. Biederman" <[email protected]>
Cc Andy Currid <[email protected]>
Cc Peer Chen <[email protected]>
Cc Prakash Punnoor <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Michael Chan <[email protected]>
---
 drivers/pci/quirks.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Index: linux-2.6.24-rc3-mm1/drivers/pci/quirks.c
===================================================================

drivers/pci/quirks.c +27 -0
@@ -1681,6 +1681,33 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SE
 			PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
 			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.
  */