[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1381479385-1614-1-git-send-email-tianyu.lan@intel.com>
Date: Fri, 11 Oct 2013 16:16:25 +0800
From: tianyu.lan@...el.com
To: lenb@...nel.org, rjw@...ysocki.net
Cc: Lan Tianyu <tianyu.lan@...el.com>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] ACPI/Power: Check physical device's runtime pm status before requesting to resume it
From: Lan Tianyu <tianyu.lan@...el.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@...el.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists