aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 2329f941a0dc..fde41cc14734 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -164,7 +164,6 @@ int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap)
164 return __pci_bus_find_cap(bus, devfn, hdr_type & 0x7f, cap); 164 return __pci_bus_find_cap(bus, devfn, hdr_type & 0x7f, cap);
165} 165}
166 166
167#if 0
168/** 167/**
169 * pci_find_ext_capability - Find an extended capability 168 * pci_find_ext_capability - Find an extended capability
170 * @dev: PCI device to query 169 * @dev: PCI device to query
@@ -212,7 +211,7 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap)
212 211
213 return 0; 212 return 0;
214} 213}
215#endif /* 0 */ 214EXPORT_SYMBOL_GPL(pci_find_ext_capability);
216 215
217/** 216/**
218 * pci_find_parent_resource - return resource region of parent bus of given region 217 * pci_find_parent_resource - return resource region of parent bus of given region
@@ -461,9 +460,23 @@ int
461pci_restore_state(struct pci_dev *dev) 460pci_restore_state(struct pci_dev *dev)
462{ 461{
463 int i; 462 int i;
463 int val;
464 464
465 for (i = 0; i < 16; i++) 465 /*
466 pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]); 466 * The Base Address register should be programmed before the command
467 * register(s)
468 */
469 for (i = 15; i >= 0; i--) {
470 pci_read_config_dword(dev, i * 4, &val);
471 if (val != dev->saved_config_space[i]) {
472 printk(KERN_DEBUG "PM: Writing back config space on "
473 "device %s at offset %x (was %x, writing %x)\n",
474 pci_name(dev), i,
475 val, (int)dev->saved_config_space[i]);
476 pci_write_config_dword(dev,i * 4,
477 dev->saved_config_space[i]);
478 }
479 }
467 pci_restore_msi_state(dev); 480 pci_restore_msi_state(dev);
468 pci_restore_msix_state(dev); 481 pci_restore_msix_state(dev);
469 return 0; 482 return 0;