]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] increment pos before looking for the next cap in __pci_find_next_ht_cap
authorBrice Goglin <brice@myri.com>
Thu, 11 Jan 2007 07:15:29 +0000 (23:15 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Fri, 12 Jan 2007 02:18:20 +0000 (18:18 -0800)
While testing 2.6.20-rc3 on a machine with some CK804 chipsets, we noticed
that quirk_nvidia_ck804_msi_ht_cap() was not detecting HT MSI capabilities
anymore.  It is actually caused by the MSI mapping on the root chipset
being the 2nd HT capability in the chain.  pci_find_ht_capability() does
not seem to find anything but the first HT cap correctly, because it
forgets to increment the position before looking for the next cap.  The
following patch seems to fix it.

At least, this proves that having a ttl is good idea since the machine
would have been stucked in an infinite loop if we didn't have a ttl :)

We have to pass pos + PCI_CAP_LIST_NEXT to __pci_find_next_cap_ttl to
get the next HT cap instead of the same one again.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew J. Gallatin <gallatin@myri.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pci/pci.c

index 6bfb942428e41dd733123a3f3993fdc53802f64b..206c834d263a8ce3de6775fa2398a948756007b0 100644 (file)
@@ -254,7 +254,8 @@ static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap)
                if ((cap & mask) == ht_cap)
                        return pos;
 
-               pos = __pci_find_next_cap_ttl(dev->bus, dev->devfn, pos,
+               pos = __pci_find_next_cap_ttl(dev->bus, dev->devfn,
+                                             pos + PCI_CAP_LIST_NEXT,
                                              PCI_CAP_ID_HT, &ttl);
        }