瀏覽代碼

PM: Use pm_wakeup_pending() in __device_suspend()

Before starting to suspend a device in __device_suspend() check if
there's a request to abort the power transition and return -EBUSY
in that case.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Rafael J. Wysocki 14 年之前
父節點
當前提交
d83f905e12
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/base/power/main.c

+ 5 - 0
drivers/base/power/main.c

@@ -877,6 +877,11 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
 	if (async_error)
 	if (async_error)
 		goto End;
 		goto End;
 
 
+	if (pm_wakeup_pending()) {
+		async_error = -EBUSY;
+		goto End;
+	}
+
 	if (dev->class) {
 	if (dev->class) {
 		if (dev->class->pm) {
 		if (dev->class->pm) {
 			pm_dev_dbg(dev, state, "class ");
 			pm_dev_dbg(dev, state, "class ");