aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/power/runtime.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 117db71e84cb..60ebb04d8140 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1028,7 +1028,17 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
1028 goto out_set; 1028 goto out_set;
1029 1029
1030 if (status == RPM_SUSPENDED) { 1030 if (status == RPM_SUSPENDED) {
1031 /* It always is possible to set the status to 'suspended'. */ 1031 /*
1032 * It is invalid to suspend a device with an active child,
1033 * unless it has been set to ignore its children.
1034 */
1035 if (!dev->power.ignore_children &&
1036 atomic_read(&dev->power.child_count)) {
1037 dev_err(dev, "runtime PM trying to suspend device but active child\n");
1038 error = -EBUSY;
1039 goto out;
1040 }
1041
1032 if (parent) { 1042 if (parent) {
1033 atomic_add_unless(&parent->power.child_count, -1, 0); 1043 atomic_add_unless(&parent->power.child_count, -1, 0);
1034 notify_parent = !parent->power.ignore_children; 1044 notify_parent = !parent->power.ignore_children;