Skip to content

Commit daccf40

Browse files
rafaeljwgregkh
authored andcommitted
PM: sleep: Do not let "syscore" devices runtime-suspend during system transitions
commit 928265e upstream. There is no reason to allow "syscore" devices to runtime-suspend during system-wide PM transitions, because they are subject to the same possible failure modes as any other devices in that respect. Accordingly, change device_prepare() and device_complete() to call pm_runtime_get_noresume() and pm_runtime_put(), respectively, for "syscore" devices too. Fixes: 057d51a ("Merge branch 'pm-sleep'") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: 3.10+ <stable@vger.kernel.org> # 3.10+ Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1c422d6 commit daccf40

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎drivers/base/power/main.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ static void device_complete(struct device *dev, pm_message_t state)
10531053
const char *info = NULL;
10541054

10551055
if (dev->power.syscore)
1056-
return;
1056+
goto out;
10571057

10581058
device_lock(dev);
10591059

@@ -1083,6 +1083,7 @@ static void device_complete(struct device *dev, pm_message_t state)
10831083

10841084
device_unlock(dev);
10851085

1086+
out:
10861087
pm_runtime_put(dev);
10871088
}
10881089

@@ -1796,9 +1797,6 @@ static int device_prepare(struct device *dev, pm_message_t state)
17961797
int (*callback)(struct device *) = NULL;
17971798
int ret = 0;
17981799

1799-
if (dev->power.syscore)
1800-
return 0;
1801-
18021800
/*
18031801
* If a device's parent goes into runtime suspend at the wrong time,
18041802
* it won't be possible to resume the device. To prevent this we
@@ -1807,6 +1805,9 @@ static int device_prepare(struct device *dev, pm_message_t state)
18071805
*/
18081806
pm_runtime_get_noresume(dev);
18091807

1808+
if (dev->power.syscore)
1809+
return 0;
1810+
18101811
device_lock(dev);
18111812

18121813
dev->power.wakeup_path = false;

0 commit comments

Comments
 (0)