15 Aug, 2018

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These add a new framework for CPU idle time injection, to be used by
    all of the idle injection code in the kernel in the future, fix some
    issues and add a number of relatively small extensions in multiple
    places.

    Specifics:

    - Add a new framework for CPU idle time injection (Daniel Lezcano).

    - Add AVS support to the armada-37xx cpufreq driver (Gregory
    CLEMENT).

    - Add support for current CPU frequency reporting to the ACPI CPPC
    cpufreq driver (George Cherian).

    - Rework the cooling device registration in the imx6q/thermal driver
    (Bastian Stender).

    - Make the pcc-cpufreq driver refuse to work with dynamic scaling
    governors on systems with many CPUs to avoid scalability issues
    with it (Rafael Wysocki).

    - Fix the intel_pstate driver to report different maximum CPU
    frequencies on systems where they really are different and to
    ignore the turbo active ratio if hardware-managend P-states (HWP)
    are in use; make it use the match_string() helper (Xie Yisheng,
    Srinivas Pandruvada).

    - Fix a minor deferred probe issue in the qcom-kryo cpufreq driver
    (Niklas Cassel).

    - Add a tracepoint for the tracking of frequency limits changes (from
    Andriod) to the cpufreq core (Ruchi Kandoi).

    - Fix a circular lock dependency between CPU hotplug and sysfs
    locking in the cpufreq core reported by lockdep (Waiman Long).

    - Avoid excessive error reports on driver registration failures in
    the ARM cpuidle driver (Sudeep Holla).

    - Add a new device links flag to the driver core to make links go
    away automatically on supplier driver removal (Vivek Gautam).

    - Eliminate potential race condition between system-wide power
    management transitions and system shutdown (Pingfan Liu).

    - Add a quirk to save NVS memory on system suspend for the ASUS 1025C
    laptop (Willy Tarreau).

    - Make more systems use suspend-to-idle (instead of ACPI S3) by
    default (Tristian Celestin).

    - Get rid of stack VLA usage in the low-level hibernation code on
    64-bit x86 (Kees Cook).

    - Fix error handling in the hibernation core and mark an expected
    fall-through switch in it (Chengguang Xu, Gustavo Silva).

    - Extend the generic power domains (genpd) framework to support
    attaching a device to a power domain by name (Ulf Hansson).

    - Fix device reference counting and user limits initialization in the
    devfreq core (Arvind Yadav, Matthias Kaehlcke).

    - Fix a few issues in the rk3399_dmc devfreq driver and improve its
    documentation (Enric Balletbo i Serra, Lin Huang, Nick Milner).

    - Drop a redundant error message from the exynos-ppmu devfreq driver
    (Markus Elfring)"

    * tag 'pm-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (35 commits)
    PM / reboot: Eliminate race between reboot and suspend
    PM / hibernate: Mark expected switch fall-through
    cpufreq: intel_pstate: Ignore turbo active ratio in HWP
    cpufreq: Fix a circular lock dependency problem
    cpu/hotplug: Add a cpus_read_trylock() function
    x86/power/hibernate_64: Remove VLA usage
    cpufreq: trace frequency limits change
    cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP
    cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems
    cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER
    cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC
    cpufreq: armada-37xx: Add AVS support
    dt-bindings: marvell: Add documentation for the Armada 3700 AVS binding
    PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload.
    PM / devfreq: Init user limits from OPP limits, not viceversa
    PM / devfreq: rk3399_dmc: fix spelling mistakes.
    PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer.
    dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional.
    PM / devfreq: rk3399_dmc: remove wait for dcf irq event.
    dt-bindings: clock: add rk3399 DDR3 standard speed bins.
    ...

    Linus Torvalds
     

06 Aug, 2018

1 commit

  • At present, "systemctl suspend" and "shutdown" can run in parrallel. A
    system can suspend after devices_shutdown(), and resume. Then the shutdown
    task goes on to power off. This causes many devices are not really shut
    off. Hence replacing reboot_mutex with system_transition_mutex (renamed
    from pm_mutex) to achieve the exclusion. The renaming of pm_mutex as
    system_transition_mutex can be better to reflect the purpose of the mutex.

    Signed-off-by: Pingfan Liu
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Pingfan Liu
     

20 Jun, 2018

1 commit

  • Since swait basically implemented exclusive waits only, make sure
    the API reflects that.

    $ git grep -l -e "\"
    -e "\" | while read file;
    do
    sed -i -e 's/\/&_one/g'
    -e 's/\/&_exclusive/g' $file;
    done

    With a few manual touch-ups.

    Suggested-by: Linus Torvalds
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Acked-by: Linus Torvalds
    Cc: bigeasy@linutronix.de
    Cc: oleg@redhat.com
    Cc: paulmck@linux.vnet.ibm.com
    Cc: pbonzini@redhat.com
    Link: https://lkml.kernel.org/r/20180612083909.261946548@infradead.org

    Peter Zijlstra
     

27 May, 2018

3 commits

  • The `s2idle_lock' is acquired during suspend while interrupts are
    disabled even on RT. The lock is acquired for short sections only.
    Make it a RAW lock which avoids "sleeping while atomic" warnings on RT.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rafael J. Wysocki

    Sebastian Andrzej Siewior
     
  • s2idle_wait_head is used during s2idle with interrupts disabled even on
    RT. There is no "custom" wake up function so swait could be used instead
    which is also lower weight compared to the wait_queue.
    Make s2idle_wait_head a swait_queue_head.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rafael J. Wysocki

    Sebastian Andrzej Siewior
     
  • timekeeping suspend/resume calls read_persistent_clock() which takes
    rtc_lock. That results in might sleep warnings because at that point
    we run with interrupts disabled.

    We cannot convert rtc_lock to a raw spinlock as that would trigger
    other might sleep warnings.

    As a workaround we disable the might sleep warnings by setting
    system_state to SYSTEM_SUSPEND before calling sysdev_suspend() and
    restoring it to SYSTEM_RUNNING afer sysdev_resume(). There is no lock
    contention because hibernate / suspend to RAM is single-CPU at this
    point.

    In s2idle's case the system_state is set to SYSTEM_SUSPEND before
    timekeeping_suspend() which is invoked by the last CPU. In the resume
    case it set back to SYSTEM_RUNNING after timekeeping_resume() which is
    invoked by the first CPU in the resume case. The other CPUs will block
    on tick_freeze_lock.

    Signed-off-by: Thomas Gleixner
    [bigeasy: cover s2idle in tick_freeze() / tick_unfreeze()]
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rafael J. Wysocki

    Thomas Gleixner
     

03 Apr, 2018

1 commit

  • Using this helper allows us to avoid the in-kernel calls to the
    sys_sync() syscall. The ksys_ prefix denotes that this function
    is meant as a drop-in replacement for the syscall. In particular, it
    uses the same calling convention as sys_sync().

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: Alexander Viro
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     

09 Nov, 2017

1 commit

  • Problem: This flag does not get cleared currently in the suspend or
    resume path in the following cases:

    * In case some driver's suspend routine returns an error.
    * Successful s2idle case
    * etc?

    Why is this a problem: What happens is that the next suspend attempt
    could fail even though the user did not enable the flag by writing to
    /sys/power/wakeup_count. This is 1 use case how the issue can be seen
    (but similar use case with driver suspend failure can be thought of):

    1. Read /sys/power/wakeup_count
    2. echo count > /sys/power/wakeup_count
    3. echo freeze > /sys/power/wakeup_count
    4. Let the system suspend, and wakeup the system using some wake source
    that calls pm_wakeup_event() e.g. power button or something.
    5. Note that the combined wakeup count would be incremented due
    to the pm_wakeup_event() in the resume path.
    6. After resuming the events_check_enabled flag is still set.

    At this point if the user attempts to freeze again (without writing to
    /sys/power/wakeup_count), the suspend would fail even though there has
    been no wake event since the past resume.

    Address that by clearing the flag just before a resume is completed,
    so that it is always cleared for the corner cases mentioned above.

    Signed-off-by: Rajat Jain
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Rajat Jain
     

29 Sep, 2017

1 commit

  • The role of the ->wake() platform callback for suspend-to-idle is to
    deal with possible spurious wakeups, among other things. The ACPI
    implementation of it, acpi_s2idle_wake(), additionally checks the
    conditions for entering the Low Power S0 Idle state by the platform
    and reports the ones that have not been met.

    However, the ->wake() platform callback is invoked after calling
    dpm_noirq_resume_devices(), which means that the power states of some
    devices may have changed since s2idle_enter() returned, so some unmet
    Low Power S0 Idle conditions may be reported incorrectly as a result
    of that.

    To avoid these false positives, reorder the invocations of the
    dpm_noirq_resume_devices() routine and the ->wake() platform callback
    in s2idle_loop().

    Fixes: 726fb6b4f2a8 (ACPI / PM: Check low power idle constraints for debug only)
    Tested-by: Srinivas Pandruvada
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

11 Aug, 2017

3 commits


05 Aug, 2017

1 commit

  • Modify the ACPI system sleep support setup code to select
    suspend-to-idle as the default system sleep state if
    (1) the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT and
    (2) the Low Power Idle S0 _DSM interface has been discovered and
    (3) the default sleep state was not selected from the kernel command
    line.

    The main motivation for this change is that systems where the (1) and
    (2) conditions are met typically ship with OSes that don't exercise
    the S3 path in the platform firmware which remains untested and turns
    out to be non-functional at least in some cases.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mario Limonciello

    Rafael J. Wysocki
     

25 Jul, 2017

4 commits

  • Define a common prefix ("PM:") for messages printed by the
    code in kernel/power/suspend.c.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Andy Shevchenko

    Rafael J. Wysocki
     
  • Some messages in suspend.c currently print state names from
    pm_states[], but that may be confusing if the mem_sleep sysfs
    attribute is changed to anything different from "mem", because
    in those cases the messages will say either "freeze" or "standby"
    after writing "mem" to /sys/power/state.

    To avoid the confusion, use mem_sleep_labels[] strings in those
    messages instead.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Andy Shevchenko

    Rafael J. Wysocki
     
  • Restore the pm_wakeup_pending() check in __device_suspend_noirq()
    removed by commit eed4d47efe95 (ACPI / sleep: Ignore spurious SCI
    wakeups from suspend-to-idle) as that allows the function to return
    earlier if there's a wakeup event pending already (so that it may
    spend less time on carrying out operations that will be reversed
    shortly anyway) and rework the main suspend-to-idle loop to take
    that optimization into account.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • As a preparation for subsequent changes, rearrange the core
    suspend-to-idle code by moving the initial invocation of
    dpm_suspend_noirq() into s2idle_loop().

    This also causes debug messages from that code to appear in
    a less confusing order.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

22 Jul, 2017

3 commits

  • Regardless of whether or not debug messages from the core system
    suspend/hibernation code are enabled, it is useful to know when
    system-wide transitions start and finish (or fail), so print "info"
    messages at these points.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Mark Salyzyn

    Rafael J. Wysocki
     
  • Debug messages from the system suspend/hibernation infrastructure can
    fill up the entire kernel log buffer in some cases and anyway they
    are only useful for debugging. They depend on CONFIG_PM_DEBUG, but
    that is set as a rule as some generally useful diagnostic facilities
    depend on it too.

    For this reason, avoid printing those messages by default, but make
    it possible to turn them on as needed with the help of a new sysfs
    attribute under /sys/power/.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Have the core suspend/resume framework store the system-wide suspend
    state (suspend_state_t) we are about to enter, and expose it to drivers
    via pm_suspend_target_state in order to retrieve that. The state is
    assigned in suspend_devices_and_enter().

    This is useful for platform specific drivers that may need to take a
    slightly different suspend/resume path based on the system's
    suspend/resume state being entered.

    Signed-off-by: Florian Fainelli
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Florian Fainelli
     

15 Jun, 2017

1 commit

  • The ACPI SCI (System Control Interrupt) is set up as a wakeup IRQ
    during suspend-to-idle transitions and, consequently, any events
    signaled through it wake up the system from that state. However,
    on some systems some of the events signaled via the ACPI SCI while
    suspended to idle should not cause the system to wake up. In fact,
    quite often they should just be discarded.

    Arguably, systems should not resume entirely on such events, but in
    order to decide which events really should cause the system to resume
    and which are spurious, it is necessary to resume up to the point
    when ACPI SCIs are actually handled and processed, which is after
    executing dpm_resume_noirq() in the system resume path.

    For this reasons, add a loop around freeze_enter() in which the
    platforms can process events signaled via multiplexed IRQ lines
    like the ACPI SCI and add suspend-to-idle hooks that can be
    used for this purpose to struct platform_freeze_ops.

    In the ACPI case, the ->wake hook is used for checking if the SCI
    has triggered while suspended and deferring the interrupt-induced
    system wakeup until the events signaled through it are actually
    processed sufficiently to decide whether or not the system should
    resume. In turn, the ->sync hook allows all of the relevant event
    queues to be flushed so as to prevent events from being missed due
    to race conditions.

    In addition to that, some ACPI code processing wakeup events needs
    to be modified to use the "hard" version of wakeup triggers, so that
    it will cause a system resume to happen on device-induced wakeup
    events even if the "soft" mechanism to prevent the system from
    suspending is not enabled. However, to preserve the existing
    behavior with respect to suspend-to-RAM, this only is done in
    the suspend-to-idle case and only if an SCI has occurred while
    suspended.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

07 Jun, 2017

1 commit

  • Revert commit eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups
    from suspend-to-idle) as it turned out to be premature and triggered
    a number of different issues on various systems.

    That includes, but is not limited to, premature suspend-to-RAM aborts
    on Dell XPS 13 (9343) reported by Dominik.

    The issue the commit in question attempted to address is real and
    will need to be taken care of going forward, but evidently more work
    is needed for this purpose.

    Reported-by: Dominik Brodowski
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

06 May, 2017

1 commit

  • The ACPI SCI (System Control Interrupt) is set up as a wakeup IRQ
    during suspend-to-idle transitions and, consequently, any events
    signaled through it wake up the system from that state. However,
    on some systems some of the events signaled via the ACPI SCI while
    suspended to idle should not cause the system to wake up. In fact,
    quite often they should just be discarded.

    Arguably, systems should not resume entirely on such events, but in
    order to decide which events really should cause the system to resume
    and which are spurious, it is necessary to resume up to the point
    when ACPI SCIs are actually handled and processed, which is after
    executing dpm_resume_noirq() in the system resume path.

    For this reasons, add a loop around freeze_enter() in which the
    platforms can process events signaled via multiplexed IRQ lines
    like the ACPI SCI and add suspend-to-idle hooks that can be
    used for this purpose to struct platform_freeze_ops.

    In the ACPI case, the ->wake hook is used for checking if the SCI
    has triggered while suspended and deferring the interrupt-induced
    system wakeup until the events signaled through it are actually
    processed sufficiently to decide whether or not the system should
    resume. In turn, the ->sync hook allows all of the relevant event
    queues to be flushed so as to prevent events from being missed due
    to race conditions.

    In addition to that, some ACPI code processing wakeup events needs
    to be modified to use the "hard" version of wakeup triggers, so that
    it will cause a system resume to happen on device-induced wakeup
    events even if the "soft" mechanism to prevent the system from
    suspending is not enabled (that also helps to catch device-induced
    wakeup events occurring during suspend transitions in progress).

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

20 Jan, 2017

1 commit


22 Nov, 2016

2 commits

  • Modify the ACPI system sleep support setup code to select
    suspend-to-idle as the default system sleep state if the
    ACPI_FADT_LOW_POWER_S0 flag is set in the FADT and the
    default sleep state was not selected from the kernel command
    line.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mario Limonciello

    Rafael J. Wysocki
     
  • There are systems in which the platform doesn't support any special
    sleep states, so suspend-to-idle (PM_SUSPEND_FREEZE) is the only
    available system sleep state. However, some user space frameworks
    only use the "mem" and (sometimes) "standby" sleep state labels, so
    the users of those systems need to modify user space in order to be
    able to use system suspend at all and that may be a pain in practice.

    Commit 0399d4db3edf (PM / sleep: Introduce command line argument for
    sleep state enumeration) attempted to address this problem by adding
    a command line argument to change the meaning of the "mem" string in
    /sys/power/state to make it trigger suspend-to-idle (instead of
    suspend-to-RAM).

    However, there also are systems in which the platform does support
    special sleep states, but suspend-to-idle is the preferred one anyway
    (it even may save more energy than the platform-provided sleep states
    in some cases) and the above commit doesn't help in those cases.

    For this reason, rework the system sleep state selection interface
    again (but preserve backwards compatibiliby). Namely, add a new
    sysfs file, /sys/power/mem_sleep, that will control the system
    suspend mode triggered by writing "mem" to /sys/power/state (in
    analogy with what /sys/power/disk does for hibernation). Make it
    select suspend-to-RAM ("deep" sleep) by default (if supported) and
    fall back to suspend-to-idle ("s2idle") otherwise and add a new
    command line argument, mem_sleep_default, allowing that default to
    be overridden if need be.

    At the same time, drop the relative_sleep_states command line
    argument that doesn't make sense any more.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mario Limonciello

    Rafael J. Wysocki
     

24 Oct, 2016

1 commit

  • Commit 4bcc595ccd80 (printk: reinstate KERN_CONT for printing
    continuation lines) exposed a missing KERN_CONT from one of the
    messages shown on entering suspend. With v4.9-rc1, the 'done.' shown
    after syncing the filesystems no longer appears as a continuation but
    a new message with its own timestamp.

    [ 9.259566] PM: Syncing filesystems ... [ 9.264119] done.

    Fix this by adding the KERN_CONT log level for the 'done.' part of the
    message seen after syncing filesystems. While we are at it, convert
    these suspend printks to pr_info and pr_cont, respectively.

    Signed-off-by: Jon Hunter
    Signed-off-by: Rafael J. Wysocki

    Jon Hunter
     

13 Sep, 2016

1 commit

  • Suspend-to-idle (aka the "freeze" sleep state) is a system sleep state
    in which all of the processors enter deepest possible idle state and
    wait for interrupts right after suspending all the devices.

    There is no hard requirement for a platform to support and register
    platform specific suspend_ops to enter suspend-to-idle/freeze state.
    Only deeper system sleep states like PM_SUSPEND_STANDBY and
    PM_SUSPEND_MEM rely on such low level support/implementation.

    suspend-to-idle can be entered as along as all the devices can be
    suspended. This patch enables the support for suspend-to-idle even on
    systems that don't have any low level support for deeper system sleep
    states and/or don't register any platform specific suspend_ops.

    Signed-off-by: Sudeep Holla
    Tested-by: Andy Gross
    Signed-off-by: Rafael J. Wysocki

    Sudeep Holla
     

28 Jun, 2016

1 commit


23 Mar, 2016

1 commit

  • Use the more common logging method with the eventual goal of removing
    pr_warning altogether.

    Miscellanea:

    - Realign arguments
    - Coalesce formats
    - Add missing space between a few coalesced formats

    Signed-off-by: Joe Perches
    Acked-by: Rafael J. Wysocki [kernel/power/suspend.c]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

11 Feb, 2016

1 commit


14 Oct, 2015

1 commit

  • There are quite a few cases in which device drivers, bus types or
    even the PM core itself may benefit from knowing whether or not
    the platform firmware will be involved in the upcoming system power
    transition (during system suspend) or whether or not it was involved
    in it (during system resume).

    For this reason, introduce global system suspend flags that can be
    used by the platform code to expose that information for the benefit
    of the other parts of the kernel and make the ACPI core set them
    as appropriate.

    Users of the new flags will be added later.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

01 Aug, 2015

1 commit

  • The Linux kernel suspend path has traditionally invoked sys_sync()
    before freezing user threads.

    But sys_sync() can be expensive, and some user-space OS's do not want
    the kernel to pay the cost of sys_sync() on every suspend -- preferring
    invoke sync() from user-space if/when they want it.

    So make sys_sync on suspend build-time optional.

    The default is unchanged.

    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Len Brown
     

19 May, 2015

1 commit

  • If a wakeup source is found to be pending in the last stage of
    suspend after syscore suspend, then the machine won't suspend, but
    suspend_enter() will return 0. That is confusing, as wakeup detection
    elsewhere causes -EBUSY to be returned from suspend_enter().

    To avoid the confusion, make suspend_enter() return -EBUSY in that
    case too.

    Signed-off-by: Ruchi Kandoi
    [ rjw: Subject and changelog ]
    Signed-off-by: Rafael J. Wysocki

    Ruchi Kandoi
     

13 May, 2015

1 commit

  • Some of the system suspend diagnostic messages related to
    suspend-to-idle refer to it as "freeze sleep" or "freeze state"
    while the others say "suspend-to-idle". To reduce the possible
    confusion that may result from that, refine the former either to
    say "suspend to idle" too or to make it clearer that what is printed
    is a state string written to /sys/power/state ("mem", "standby",
    or "freeze").

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

26 Feb, 2015

1 commit

  • When CONFIG_PM_DEBUG=y, we provide a sysfs file (/sys/power/pm_test) for
    selecting one of a few suspend test modes, where rather than entering a
    full suspend state, the kernel will perform some subset of suspend
    steps, wait 5 seconds, and then resume back to normal operation.

    This mode is useful for (among other things) observing the state of the
    system just before entering a sleep mode, for debugging or analysis
    purposes. However, a constant 5 second wait is not sufficient for some
    sorts of analysis; for example, on an SoC, one might want to use
    external tools to probe the power states of various on-chip controllers
    or clocks.

    This patch turns this 5 second delay into a configurable module
    parameter, so users can determine how long to wait in this
    pseudo-suspend state before resuming the system.

    Example (wait 30 seconds);

    # echo 30 > /sys/module/suspend/parameters/pm_test_delay
    # echo core > /sys/power/pm_test
    # time echo mem > /sys/power/state
    ...
    [ 17.583625] suspend debug: Waiting for 30 second(s).
    ...
    real 0m30.381s
    user 0m0.017s
    sys 0m0.080s

    Signed-off-by: Brian Norris
    Acked-by: Pavel Machek
    Reviewed-by: Kevin Cernekee
    Acked-by: Florian Fainelli
    Signed-off-by: Rafael J. Wysocki

    Brian Norris
     

14 Feb, 2015

1 commit

  • In preparation for adding support for quiescing timers in the final
    stage of suspend-to-idle transitions, rework the freeze_enter()
    function making the system wait on a wakeup event, the freeze_wake()
    function terminating the suspend-to-idle loop and the mechanism by
    which deep idle states are entered during suspend-to-idle.

    First of all, introduce a simple state machine for suspend-to-idle
    and make the code in question use it.

    Second, prevent freeze_enter() from losing wakeup events due to race
    conditions and ensure that the number of online CPUs won't change
    while it is being executed. In addition to that, make it force
    all of the CPUs re-enter the idle loop in case they are in idle
    states already (so they can enter deeper idle states if possible).

    Next, drop cpuidle_use_deepest_state() and replace use_deepest_state
    checks in cpuidle_select() and cpuidle_reflect() with a single
    suspend-to-idle state check in cpuidle_idle_call().

    Finally, introduce cpuidle_enter_freeze() that will simply find the
    deepest idle state available to the given CPU and enter it using
    cpuidle_enter().

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)

    Rafael J. Wysocki
     

09 Nov, 2014

1 commit


01 Oct, 2014

2 commits

  • The ACPI GPE wakeup from suspend-to-idle is currently based on using
    the IRQF_NO_SUSPEND flag for the ACPI SCI, but that is problematic
    for a couple of reasons. First, in principle the ACPI SCI may be
    shared and IRQF_NO_SUSPEND does not really work well with shared
    interrupts. Second, it may require the ACPI subsystem to special-case
    the handling of device notifications depending on whether or not
    they are received during suspend-to-idle in some places which would
    lead to fragile code. Finally, it's better the handle ACPI wakeup
    interrupts consistently with wakeup interrupts from other sources.

    For this reason, remove the IRQF_NO_SUSPEND flag from the ACPI SCI
    and use enable_irq_wake()/disable_irq_wake() with it instead, which
    requires two additional platform hooks to be added to struct
    platform_freeze_ops.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Rename several local functions related to platform handling during
    system suspend resume in suspend.c so that their names better
    reflect their roles.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki