lkml.org 
[lkml]   [2012]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC][PATCH 6/8] PM / Sleep: Implement opportunistic sleep
    From
    On Thu, Apr 26, 2012 at 2:52 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
    ...
    > From: Rafael J. Wysocki <rjw@sisk.pl>
    > Subject: PM / Sleep: Implement opportunistic sleep, v2
    >
    > Introduce a mechanism by which the kernel can trigger global
    > transitions to a sleep state chosen by user space if there are no
    > active wakeup sources.
    >
    > It consists of a new sysfs attribute, /sys/power/autosleep, that
    > can be written one of the strings returned by reads from
    > /sys/power/state, an ordered workqueue and a work item carrying out
    > the "suspend" operations.  If a string representing the system's
    > sleep state is written to /sys/power/autosleep, the work item
    > triggering transitions to that state is queued up and it requeues
    > itself after every execution until user space writes "off" to
    > /sys/power/autosleep.
    >

    This does not work. Writing something other than "off" disabled auto
    suspend for me.

    ...
    > +static ssize_t autosleep_store(struct kobject *kobj,
    > +                              struct kobj_attribute *attr,
    > +                              const char *buf, size_t n)
    > +{
    > +       suspend_state_t state = decode_state(buf, n);
    > +       int error;
    > +
    > +       if (state == PM_SUSPEND_ON
    > +           && !(strncmp(buf, "off", 3) && strncmp(buf, "off\n", 4)))
    > +               return -EINVAL;

    Did you mean:
    if (state == PM_SUSPEND_ON
    && strcmp(buf, "off") && strcmp(buf, "off\n"))
    return -EINVAL;

    --
    Arve Hjønnevåg
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-05-03 02:41    [W:0.035 / U:35.812 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site