aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-04-29 16:52:19 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-01 15:24:50 -0400
commit52d136cc2cf6659ee247dbcc88c9e7bd7428ad06 (patch)
tree79b12b415860db0081d006a7b8436dbf14fc9da3 /drivers/base
parent5a21d489fd9541a4a66b9a500659abaca1b19a51 (diff)
PM / Sleep: Look for wakeup events in later stages of device suspend
Currently, the device suspend code in drivers/base/power/main.c only checks if there have been any wakeup events, and therefore the ongoing system transition to a sleep state should be aborted, during the first (i.e. "suspend") device suspend phase. However, wakeup events may be reported later as well, so it's reasonable to look for them in the in the subsequent (i.e. "late suspend" and "suspend noirq") phases. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index b462c0e341cb..e0fb5b0435a3 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -889,6 +889,11 @@ static int dpm_suspend_noirq(pm_message_t state)
889 if (!list_empty(&dev->power.entry)) 889 if (!list_empty(&dev->power.entry))
890 list_move(&dev->power.entry, &dpm_noirq_list); 890 list_move(&dev->power.entry, &dpm_noirq_list);
891 put_device(dev); 891 put_device(dev);
892
893 if (pm_wakeup_pending()) {
894 error = -EBUSY;
895 break;
896 }
892 } 897 }
893 mutex_unlock(&dpm_list_mtx); 898 mutex_unlock(&dpm_list_mtx);
894 if (error) 899 if (error)
@@ -962,6 +967,11 @@ static int dpm_suspend_late(pm_message_t state)
962 if (!list_empty(&dev->power.entry)) 967 if (!list_empty(&dev->power.entry))
963 list_move(&dev->power.entry, &dpm_late_early_list); 968 list_move(&dev->power.entry, &dpm_late_early_list);
964 put_device(dev); 969 put_device(dev);
970
971 if (pm_wakeup_pending()) {
972 error = -EBUSY;
973 break;
974 }
965 } 975 }
966 mutex_unlock(&dpm_list_mtx); 976 mutex_unlock(&dpm_list_mtx);
967 if (error) 977 if (error)