]> err.no Git - linux-2.6/commitdiff
Merge branch 'master' into upstream
authorJeff Garzik <jeff@garzik.org>
Wed, 14 Jun 2006 00:29:04 +0000 (20:29 -0400)
committerJeff Garzik <jeff@garzik.org>
Wed, 14 Jun 2006 00:29:04 +0000 (20:29 -0400)
1  2 
drivers/pci/pci.c

diff --combined drivers/pci/pci.c
index 8d107c6c2c70f45f7113a620eed0e6c0f414a640,12286275b1c81ce3029f3dbd3e9f8127e495c4ea..fde41cc147344d3faf1bca11078dc951062e01be
@@@ -164,6 -164,7 +164,6 @@@ int pci_bus_find_capability(struct pci_
        return __pci_bus_find_cap(bus, devfn, hdr_type & 0x7f, cap);
  }
  
 -#if 0
  /**
   * pci_find_ext_capability - Find an extended capability
   * @dev: PCI device to query
@@@ -211,7 -212,7 +211,7 @@@ int pci_find_ext_capability(struct pci_
  
        return 0;
  }
 -#endif  /*  0  */
 +EXPORT_SYMBOL_GPL(pci_find_ext_capability);
  
  /**
   * pci_find_parent_resource - return resource region of parent bus of given region
@@@ -460,9 -461,23 +460,23 @@@ in
  pci_restore_state(struct pci_dev *dev)
  {
        int i;
+       int val;
  
-       for (i = 0; i < 16; i++)
-               pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]);
+       /*
+        * The Base Address register should be programmed before the command
+        * register(s)
+        */
+       for (i = 15; i >= 0; i--) {
+               pci_read_config_dword(dev, i * 4, &val);
+               if (val != dev->saved_config_space[i]) {
+                       printk(KERN_DEBUG "PM: Writing back config space on "
+                               "device %s at offset %x (was %x, writing %x)\n",
+                               pci_name(dev), i,
+                               val, (int)dev->saved_config_space[i]);
+                       pci_write_config_dword(dev,i * 4,
+                               dev->saved_config_space[i]);
+               }
+       }
        pci_restore_msi_state(dev);
        pci_restore_msix_state(dev);
        return 0;