PCI: Suspend and resume PCI Express ports with interrupts disabled

I don't see why the suspend and resume of PCI Express ports should be
handled with interrupts enabled and it may even lead to problems in
some situations.  For this reason, move the suspending and resuming
of PCI Express ports into ->suspend_late() and ->resume_early()
callbacks executed with interrupts disabled.

This patch addresses the regression from 2.6.26 tracked as
http://bugzilla.kernel.org/show_bug.cgi?id=12121 .

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
Rafael J. Wysocki 2008-12-06 15:07:59 +01:00 коммит произвёл Jesse Barnes
Родитель c70e0d9dfe
Коммит 90d25f246d
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -50,7 +50,7 @@ static int pcie_portdrv_restore_config(struct pci_dev *dev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int pcie_portdrv_suspend(struct pci_dev *dev, pm_message_t state) static int pcie_portdrv_suspend_late(struct pci_dev *dev, pm_message_t state)
{ {
int ret = pcie_port_device_suspend(dev, state); int ret = pcie_port_device_suspend(dev, state);
@ -59,14 +59,14 @@ static int pcie_portdrv_suspend(struct pci_dev *dev, pm_message_t state)
return ret; return ret;
} }
static int pcie_portdrv_resume(struct pci_dev *dev) static int pcie_portdrv_resume_early(struct pci_dev *dev)
{ {
pcie_portdrv_restore_config(dev); pcie_portdrv_restore_config(dev);
return pcie_port_device_resume(dev); return pcie_port_device_resume(dev);
} }
#else #else
#define pcie_portdrv_suspend NULL #define pcie_portdrv_suspend_late NULL
#define pcie_portdrv_resume NULL #define pcie_portdrv_resume_early NULL
#endif #endif
/* /*
@ -282,8 +282,8 @@ static struct pci_driver pcie_portdriver = {
.probe = pcie_portdrv_probe, .probe = pcie_portdrv_probe,
.remove = pcie_portdrv_remove, .remove = pcie_portdrv_remove,
.suspend = pcie_portdrv_suspend, .suspend_late = pcie_portdrv_suspend_late,
.resume = pcie_portdrv_resume, .resume_early = pcie_portdrv_resume_early,
.err_handler = &pcie_portdrv_err_handler, .err_handler = &pcie_portdrv_err_handler,
}; };