linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI / ACPI / PM: Resume bridges w/o drivers on suspend-to-RAM
@ 2018-06-26 10:06 Rafael J. Wysocki
  2018-06-26 10:33 ` Mika Westerberg
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2018-06-26 10:06 UTC (permalink / raw)
  To: Linux PCI
  Cc: n0000b.n000b, Bjorn Helgaas, Mika Westerberg, LKML, Linux ACPI,
	Linux PM, Lukas Wunner

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

It is reported that commit c62ec4610c40 (PM / core: Fix direct_complete
handling for devices with no callbacks) introduced a system suspend
regression on Samsung 305V4A by allowing a PCI bridge (not a PCIe
port) to stay in D3 over suspend-to-RAM, which is a side effect of
setting power.direct_complete for the children of that bridge that
have no PM callbacks.

On the majority of systems PCI bridges are not allowed to be
runtime-suspended (the power/control sysfs attribute is set to "on"
for them by default), but user space can change that setting and if
it does so and a given bridge has no children with PM callbacks, the
direct_complete optimization will be applied to it and it will stay
in suspend over system suspend.  Apparently, that confuses the
platform firmware on the affected machine and that may very well
happen elsewhere, so avoid the direct_complete optimization for
PCI bridges with no drivers (if there is a driver, it should take
care of the PM handling) on suspend-to-RAM altogether (that should
not matter for suspend-to-idle as platform firmware is not involved
in it).

Fixes: c62ec4610c40 (PM / core: Fix direct_complete handling for devices with no callbacks)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=199941
Reported-by: n0000b.n000b@gmail.com
Tested-by: n0000b.n000b@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/pci/pci-acpi.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-pm/drivers/pci/pci-acpi.c
===================================================================
--- linux-pm.orig/drivers/pci/pci-acpi.c
+++ linux-pm/drivers/pci/pci-acpi.c
@@ -638,6 +638,14 @@ static bool acpi_pci_need_resume(struct
 	if (acpi_target_system_state() == ACPI_STATE_S0)
 		return false;
 
+	/*
+	 * In some cases (eg. Samsung 305V4A) leaving a bridge in suspend
+	 * confuses the platform firmware, so avoid doing that, unless the
+	 * bridge has a driver that should take care of PM handling.
+	 */
+	if (pci_is_bridge(dev) && !dev->driver)
+		return true;
+
 	return !!adev->power.flags.dsw_present;
 }
 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-30 21:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-26 10:06 [PATCH] PCI / ACPI / PM: Resume bridges w/o drivers on suspend-to-RAM Rafael J. Wysocki
2018-06-26 10:33 ` Mika Westerberg
2018-06-26 14:01 ` Bjorn Helgaas
2018-06-26 14:22   ` Rafael J. Wysocki
2018-06-26 17:14     ` Bjorn Helgaas
2018-06-26 17:19       ` Rafael J. Wysocki
2018-06-26 20:32         ` Bjorn Helgaas
2018-06-27  7:16           ` Rafael J. Wysocki
2018-06-29  8:34 ` [PATCH v2] " Rafael J. Wysocki
2018-06-29 19:19   ` Bjorn Helgaas
2018-06-30 21:15     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).