All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCIe bridge deferred probe breaks suspend resume
@ 2018-02-24  0:46 ` Feng Kan
  0 siblings, 0 replies; 19+ messages in thread
From: Feng Kan @ 2018-02-24  0:46 UTC (permalink / raw)
  To: rjw, linux-pm, lorenzo.pieralisi, linux-arm-kernel, linux-pci,
	bhelgaas
  Cc: Feng Kan

This is not a patch, but rather a question regarding the deferred
probe's effect on PCIe PM ordering. This happens on our system
which defer the probing of root bridge due to  the IOMMU not being
ready. Because of the deferred action, the bridge is moved to the
end of the dpm_list which results in incorrect suspend and resume
sequence.

In the cases I have seen, the bridge is always reordered because of
startup sequence. They are always place after the endpoint. If that
is the case the following code should be able to prevent such cases.
However, is there some cases here that would violate such situation?
---
 drivers/base/dd.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index de6fd09..5b96d5c 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -116,15 +116,17 @@ static void deferred_probe_work_func(struct work_struct *work)
 		 */
 		mutex_unlock(&deferred_probe_mutex);
 
-		/*
-		 * Force the device to the end of the dpm_list since
-		 * the PM code assumes that the order we add things to
-		 * the list is a good order for suspend but deferred
-		 * probe makes that very unsafe.
-		 */
-		device_pm_lock();
-		device_pm_move_last(dev);
-		device_pm_unlock();
+		 if (!dev_is_pci(dev)) {
+			 /*
+			  * Force the device to the end of the dpm_list since
+			  * the PM code assumes that the order we add things to
+			  * the list is a good order for suspend but deferred
+			  * probe makes that very unsafe.
+			  */
+			 device_pm_lock();
+			 device_pm_move_last(dev);
+			 device_pm_unlock();
+		 }
 
 		dev_dbg(dev, "Retrying from deferred list\n");
 		if (initcall_debug && !initcalls_done)
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2018-02-26  9:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-24  0:46 [PATCH] PCIe bridge deferred probe breaks suspend resume Feng Kan
2018-02-24  0:46 ` Feng Kan
2018-02-24  0:46 ` Feng Kan
2018-02-24  9:35 ` Rafael J. Wysocki
2018-02-24  9:35   ` Rafael J. Wysocki
2018-02-24  9:35   ` Rafael J. Wysocki
2018-02-24  9:47   ` Rafael J. Wysocki
2018-02-24  9:47     ` Rafael J. Wysocki
2018-02-24  9:47     ` Rafael J. Wysocki
2018-02-24 13:59     ` Lukas Wunner
2018-02-25  9:29       ` Rafael J. Wysocki
2018-02-25  9:29         ` Rafael J. Wysocki
2018-02-25  9:29         ` Rafael J. Wysocki
2018-02-25 16:28         ` Feng Kan
2018-02-25 16:28           ` Feng Kan
2018-02-25 16:28           ` Feng Kan
2018-02-26  9:38           ` Rafael J. Wysocki
2018-02-26  9:38             ` Rafael J. Wysocki
2018-02-26  9:38             ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.