lkml.org 
[lkml]   [2010]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/3] PM: Use pm_wakeup_pending() in device_suspend()
    On Fri, 3 Dec 2010, Rafael J. Wysocki wrote:

    > From: Rafael J. Wysocki <rjw@sisk.pl>
    >
    > 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>
    > ---
    > drivers/base/power/main.c | 5 +++++
    > 1 file changed, 5 insertions(+)
    >
    > Index: linux-2.6/drivers/base/power/main.c
    > ===================================================================
    > --- linux-2.6.orig/drivers/base/power/main.c
    > +++ linux-2.6/drivers/base/power/main.c
    > @@ -935,6 +935,11 @@ static void async_suspend(void *data, as
    >
    > static int device_suspend(struct device *dev)
    > {
    > + if (pm_wakeup_pending()) {
    > + async_error = -EBUSY;
    > + return async_error;
    > + }
    > +
    > INIT_COMPLETION(dev->power.completion);
    >
    > if (pm_async_enabled && dev->power.async_suspend) {

    Is a similar test needed in async_suspend()? What happens if
    dpm_suspend() runs through the entire device list okay, but a wakeup
    event occurs in the middle of the async_synchronize_full() delay?

    Alan Stern



    \
     
     \ /
      Last update: 2010-12-03 16:29    [W:0.043 / U:1.056 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site