[openib-general] patch pci-use-pci_find_ht_capability-in-drivers-pci-quirks.c.patch added to gregkh-2.6 tree
gregkh at suse.de
gregkh at suse.de
Wed Dec 6 22:12:08 PST 2006
This is a note to let you know that I've just added the patch titled
Subject: PCI: Use pci_find_ht_capability() in drivers/pci/quirks.c
to my gregkh-2.6 tree. Its filename is
pci-use-pci_find_ht_capability-in-drivers-pci-quirks.c.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From michael at ozlabs.org Tue Nov 21 23:26:32 2006
From: Michael Ellerman <michael at ellerman.id.au>
To: linux-pci at atrey.karlin.mff.cuni.cz
CC: Greg Kroah-Hartman <greg at kroah.com>, Benjamin Herrenschmidt <benh at kernel.crashing.org>, Eric W. Biederman <ebiederm at xmission.com>, Segher Boessenkool <segher at kernel.crashing.org>, <support at pathscale.com>, <openib-general at openib.org>, <brice at myri.com>
Date: Wed, 22 Nov 2006 18:26:21 +1100
Subject: PCI: Use pci_find_ht_capability() in drivers/pci/quirks.c
Message-Id: <20061122072625.8B07767C3B at ozlabs.org>
Use pci_find_ht_capability() in drivers/pci/quirks.c.
I'm pretty sure the logic is unchanged here, but someone please eye-ball it
for me. I've changed the message to be a little shorter, it's now:
PCI: Found (enabled|disabled) HT MSI mapping on xxxx:xx:xx.x
Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
drivers/pci/quirks.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
--- gregkh-2.6.orig/drivers/pci/quirks.c
+++ gregkh-2.6/drivers/pci/quirks.c
@@ -1644,19 +1644,23 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AM
* return 1 if a HT MSI capability is found and enabled */
static int __devinit msi_ht_cap_enabled(struct pci_dev *dev)
{
- u8 pos;
- int ttl;
- for (pos = pci_find_capability(dev, PCI_CAP_ID_HT), ttl = 48;
- pos && ttl;
- pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_HT), ttl--) {
- u32 cap_hdr;
- /* MSI mapping section according to Hypertransport spec */
- if (pci_read_config_dword(dev, pos, &cap_hdr) == 0
- && (cap_hdr & 0xf8000000) == 0xa8000000 /* MSI mapping */) {
- printk(KERN_INFO "PCI: Found HT MSI mapping on %s with capability %s\n",
- pci_name(dev), cap_hdr & 0x10000 ? "enabled" : "disabled");
- return (cap_hdr & 0x10000) != 0; /* MSI mapping cap enabled */
+ 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: Found %s HT MSI Mapping on %s\n",
+ flags & HT_MSI_FLAGS_ENABLE ?
+ "enabled" : "disabled", pci_name(dev));
+ return (flags & HT_MSI_FLAGS_ENABLE) != 0;
}
+
+ pos = pci_find_next_ht_capability(dev, pos,
+ HT_CAPTYPE_MSI_MAPPING);
}
return 0;
}
Patches currently in gregkh-2.6 which might be from michael at ellerman.id.au are
More information about the general
mailing list