linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI/Power: Check physical device's runtime pm status before requesting to resume it
@ 2013-10-11  8:16 tianyu.lan
  2013-10-11 11:19 ` Rafael J. Wysocki
  0 siblings, 1 reply; 14+ messages in thread
From: tianyu.lan @ 2013-10-11  8:16 UTC (permalink / raw)
  To: lenb, rjw; +Cc: Lan Tianyu, linux-acpi, linux-kernel

From: Lan Tianyu <tianyu.lan@intel.com>

Currently, when one power resource is turned on, devices owning it
will be requested to resume regardless of their runtime pm status.
ACPI power resource maybe turn on in some devices' runtime pm
resume callback(E.G, usb port) while turning on the power resource
will trigger one new resume request of the device. It causes
infinite loop between resume and suspend. This has happened on
clearing usb port's PM Qos NO_POWER_OFF flag twice. This patch is
to add check of physical device's runtime pm status and request resume
if the device is suspended.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 drivers/acpi/power.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 0dbe5cd..228c138 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -250,8 +250,10 @@ static void acpi_power_resume_dependent(struct work_struct *work)
 
 	mutex_lock(&adev->physical_node_lock);
 
-	list_for_each_entry(pn, &adev->physical_node_list, node)
-		pm_request_resume(pn->dev);
+	list_for_each_entry(pn, &adev->physical_node_list, node) {
+		if (pm_runtime_suspended(pn->dev))
+			pm_request_resume(pn->dev);
+	}
 
 	list_for_each_entry(pn, &adev->power_dependent, node)
 		pm_request_resume(pn->dev);
-- 
1.8.4.rc0.1.g8f6a3e5.dirty


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

end of thread, other threads:[~2013-10-18 17:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11  8:16 [PATCH] ACPI/Power: Check physical device's runtime pm status before requesting to resume it tianyu.lan
2013-10-11 11:19 ` Rafael J. Wysocki
2013-10-15  8:58   ` Lan Tianyu
2013-10-15 21:22     ` Rafael J. Wysocki
2013-10-16  7:12       ` Lan Tianyu
2013-10-16  8:57       ` Lan Tianyu
2013-10-16  9:26       ` Lan Tianyu
2013-10-16 12:42         ` Rafael J. Wysocki
2013-10-17  1:02           ` Lan Tianyu
2013-10-17  2:40             ` Lan Tianyu
2013-10-17  8:50               ` Lan Tianyu
2013-10-17 11:38               ` Rafael J. Wysocki
2013-10-18 13:05                 ` Lan Tianyu
2013-10-18 17:54                   ` 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).