aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2015-04-10 09:27:18 -0400
committerBjorn Helgaas <bhelgaas@google.com>2015-04-10 09:27:18 -0400
commit5468d5a64bf1e002e5081fa280186d0eba09fa0e (patch)
treea9c1500d4b0cfb9db1f822dc1357c184b0f2f188 /drivers/pci/pci.c
parent4dd1f57956ada782fd80b1c11c30a9595d6caafc (diff)
parent55db3208f238ee776f1f747734051723d8a3c13e (diff)
Merge branch 'pci/misc' into next
* pci/misc: PCI: Read capability list as dwords, not bytes PCI: Don't clear ASPM bits when the FADT declares it's unsupported PCI: Clarify policy for vendor IDs in pci.txt PCI/ACPI: Optimize device state transition delays PCI: Export pci_find_host_bridge() for use inside PCI core PCI: Make a shareable UUID for PCI firmware ACPI _DSM PCI: Fix typo in Thunderbolt kernel message
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 061fdce8f8e1..acc4b6ef78c4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -146,19 +146,22 @@ static int __pci_find_next_cap_ttl(struct pci_bus *bus, unsigned int devfn,
146 u8 pos, int cap, int *ttl) 146 u8 pos, int cap, int *ttl)
147{ 147{
148 u8 id; 148 u8 id;
149 u16 ent;
150
151 pci_bus_read_config_byte(bus, devfn, pos, &pos);
149 152
150 while ((*ttl)--) { 153 while ((*ttl)--) {
151 pci_bus_read_config_byte(bus, devfn, pos, &pos);
152 if (pos < 0x40) 154 if (pos < 0x40)
153 break; 155 break;
154 pos &= ~3; 156 pos &= ~3;
155 pci_bus_read_config_byte(bus, devfn, pos + PCI_CAP_LIST_ID, 157 pci_bus_read_config_word(bus, devfn, pos, &ent);
156 &id); 158
159 id = ent & 0xff;
157 if (id == 0xff) 160 if (id == 0xff)
158 break; 161 break;
159 if (id == cap) 162 if (id == cap)
160 return pos; 163 return pos;
161 pos += PCI_CAP_LIST_NEXT; 164 pos = (ent >> 8);
162 } 165 }
163 return 0; 166 return 0;
164} 167}