Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
PM / Sleep: Look for wakeup events in later stages of device suspend
Browse files Browse the repository at this point in the history
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.

Change-Id: Idc55bb84fd820c4f0b5e037186fb337daa612fb4
Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Git-commit: 52d136c
Git-repo: git://codeaurora.org/kernel/msm.git
Signed-off-by: Anurag Singh <[email protected]>
  • Loading branch information
rjwysocki authored and Anurag Singh committed Mar 13, 2013
1 parent df48e01 commit a3d852d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,11 @@ static int dpm_suspend_noirq(pm_message_t state)
if (!list_empty(&dev->power.entry))
list_move(&dev->power.entry, &dpm_noirq_list);
put_device(dev);

if (pm_wakeup_pending()) {
error = -EBUSY;
break;
}
}
mutex_unlock(&dpm_list_mtx);
if (error)
Expand Down Expand Up @@ -990,6 +995,11 @@ static int dpm_suspend_late(pm_message_t state)
if (!list_empty(&dev->power.entry))
list_move(&dev->power.entry, &dpm_late_early_list);
put_device(dev);

if (pm_wakeup_pending()) {
error = -EBUSY;
break;
}
}
mutex_unlock(&dpm_list_mtx);
if (error)
Expand Down

0 comments on commit a3d852d

Please sign in to comment.