Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: [PATCH] PCI: reverse pci config space restore order [PATCH] PCI: Improve PCI config space writeback [PATCH] PCI: Error handling on PCI device resume [PATCH] PCI: fix pciehp compile issue when CONFIG_ACPI is not enabled
This commit is contained in:
@@ -285,9 +285,9 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
|
|||||||
* Default resume method for devices that have no driver provided resume,
|
* Default resume method for devices that have no driver provided resume,
|
||||||
* or not even a driver at all.
|
* or not even a driver at all.
|
||||||
*/
|
*/
|
||||||
static void pci_default_resume(struct pci_dev *pci_dev)
|
static int pci_default_resume(struct pci_dev *pci_dev)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval = 0;
|
||||||
|
|
||||||
/* restore the PCI config space */
|
/* restore the PCI config space */
|
||||||
pci_restore_state(pci_dev);
|
pci_restore_state(pci_dev);
|
||||||
@@ -297,18 +297,21 @@ static void pci_default_resume(struct pci_dev *pci_dev)
|
|||||||
/* if the device was busmaster before the suspend, make it busmaster again */
|
/* if the device was busmaster before the suspend, make it busmaster again */
|
||||||
if (pci_dev->is_busmaster)
|
if (pci_dev->is_busmaster)
|
||||||
pci_set_master(pci_dev);
|
pci_set_master(pci_dev);
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pci_device_resume(struct device * dev)
|
static int pci_device_resume(struct device * dev)
|
||||||
{
|
{
|
||||||
|
int error;
|
||||||
struct pci_dev * pci_dev = to_pci_dev(dev);
|
struct pci_dev * pci_dev = to_pci_dev(dev);
|
||||||
struct pci_driver * drv = pci_dev->driver;
|
struct pci_driver * drv = pci_dev->driver;
|
||||||
|
|
||||||
if (drv && drv->resume)
|
if (drv && drv->resume)
|
||||||
drv->resume(pci_dev);
|
error = drv->resume(pci_dev);
|
||||||
else
|
else
|
||||||
pci_default_resume(pci_dev);
|
error = pci_default_resume(pci_dev);
|
||||||
return 0;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pci_device_shutdown(struct device *dev)
|
static void pci_device_shutdown(struct device *dev)
|
||||||
|
@@ -461,9 +461,23 @@ int
|
|||||||
pci_restore_state(struct pci_dev *dev)
|
pci_restore_state(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
int i;
|
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_msi_state(dev);
|
||||||
pci_restore_msix_state(dev);
|
pci_restore_msix_state(dev);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -50,7 +50,7 @@
|
|||||||
extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
|
extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
|
||||||
extern acpi_status pci_osc_support_set(u32 flags);
|
extern acpi_status pci_osc_support_set(u32 flags);
|
||||||
#else
|
#else
|
||||||
#if !defined(acpi_status)
|
#if !defined(AE_ERROR)
|
||||||
typedef u32 acpi_status;
|
typedef u32 acpi_status;
|
||||||
#define AE_ERROR (acpi_status) (0x0001)
|
#define AE_ERROR (acpi_status) (0x0001)
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user