Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbbc2f6b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Jesse Barnes
Browse files

PCI PM: Do not disable and enable bridges during suspend-resume



It is a mistake to disable and enable PCI bridges and PCI Express
ports during suspend-resume, at least at the time when it is
currently done.  Disabling them may lead to problems with accessing
devices behind them and they should be automatically enabled when
their standard config spaces are restored.  Fix this by not attempting
to disable bridges during suspend and enable them during resume.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 27be54a6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -434,15 +434,17 @@ static int pci_pm_default_resume(struct pci_dev *pci_dev)
{
	pci_fixup_device(pci_fixup_resume, pci_dev);

	if (!pci_is_bridge(pci_dev))
		pci_enable_wake(pci_dev, PCI_D0, false);
	if (pci_is_bridge(pci_dev))
		return 0;

	pci_enable_wake(pci_dev, PCI_D0, false);
	return pci_pm_reenable_device(pci_dev);
}

static void pci_pm_default_suspend_generic(struct pci_dev *pci_dev)
{
	/* If device is enabled at this point, disable it */
	/* If a non-bridge device is enabled at this point, disable it */
	if (!pci_is_bridge(pci_dev))
		pci_disable_enabled_device(pci_dev);
	/*
	 * Save state with interrupts enabled, because in principle the bus the