04 Aug, 2015

1 commit

  • commit fff3b16d2754a061a3549c4307a186423a0128fd upstream.

    Many harddisks (mostly WD ones) have firmware problems and take too
    long, more than 10 seconds, to resume from suspend. And this often
    exceeds the default DPM watchdog timeout (12 seconds), resulting in a
    kernel panic out of sudden.

    Since most distros just take the default as is, we should give a bit
    more safer value. This patch increases the default value from 12
    seconds to one minute, which has been confirmed to be long enough for
    such problematic disks.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=91921
    Fixes: 70fea60d888d (PM / Sleep: Detect device suspend/resume lockup and log event)
    Signed-off-by: Takashi Iwai
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

10 Apr, 2015

1 commit


07 Apr, 2015

1 commit


18 Mar, 2015

1 commit

  • Occasionally, the system can't come back up after suspend/resume
    due to problems of device suspending phase. This patch make
    PM_TRACE infrastructure cover device suspending phase of
    suspend/resume process, and the information in RTC can tell
    developers which device suspending function make system hang.

    Signed-off-by: Zhonghui Fu
    Signed-off-by: Rafael J. Wysocki

    Zhonghui Fu
     

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
     

12 Feb, 2015

2 commits

  • Commit 5695be142e20 ("OOM, PM: OOM killed task shouldn't escape PM
    suspend") has left a race window when OOM killer manages to
    note_oom_kill after freeze_processes checks the counter. The race
    window is quite small and really unlikely and partial solution deemed
    sufficient at the time of submission.

    Tejun wasn't happy about this partial solution though and insisted on a
    full solution. That requires the full OOM and freezer's task freezing
    exclusion, though. This is done by this patch which introduces oom_sem
    RW lock and turns oom_killer_disable() into a full OOM barrier.

    oom_killer_disabled check is moved from the allocation path to the OOM
    level and we take oom_sem for reading for both the check and the whole
    OOM invocation.

    oom_killer_disable() takes oom_sem for writing so it waits for all
    currently running OOM killer invocations. Then it disable all the further
    OOMs by setting oom_killer_disabled and checks for any oom victims.
    Victims are counted via mark_tsk_oom_victim resp. unmark_oom_victim. The
    last victim wakes up all waiters enqueued by oom_killer_disable().
    Therefore this function acts as the full OOM barrier.

    The page fault path is covered now as well although it was assumed to be
    safe before. As per Tejun, "We used to have freezing points deep in file
    system code which may be reacheable from page fault." so it would be
    better and more robust to not rely on freezing points here. Same applies
    to the memcg OOM killer.

    out_of_memory tells the caller whether the OOM was allowed to trigger and
    the callers are supposed to handle the situation. The page allocation
    path simply fails the allocation same as before. The page fault path will
    retry the fault (more on that later) and Sysrq OOM trigger will simply
    complain to the log.

    Normally there wouldn't be any unfrozen user tasks after
    try_to_freeze_tasks so the function will not block. But if there was an
    OOM killer racing with try_to_freeze_tasks and the OOM victim didn't
    finish yet then we have to wait for it. This should complete in a finite
    time, though, because

    - the victim cannot loop in the page fault handler (it would die
    on the way out from the exception)
    - it cannot loop in the page allocator because all the further
    allocation would fail and __GFP_NOFAIL allocations are not
    acceptable at this stage
    - it shouldn't be blocked on any locks held by frozen tasks
    (try_to_freeze expects lockless context) and kernel threads and
    work queues are not frozen yet

    Signed-off-by: Michal Hocko
    Suggested-by: Tejun Heo
    Cc: David Rientjes
    Cc: Johannes Weiner
    Cc: Oleg Nesterov
    Cc: Cong Wang
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     
  • While touching this area let's convert printk to pr_*. This also makes
    the printing of continuation lines done properly.

    Signed-off-by: Michal Hocko
    Acked-by: Tejun Heo
    Cc: David Rientjes
    Cc: Johannes Weiner
    Cc: Oleg Nesterov
    Cc: Cong Wang
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     

11 Feb, 2015

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "We have a few new features this time, including a new SFI-based
    cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new
    devfreq class for providing its governors with raw utilization data
    and a new ACPI driver for AMD SoCs.

    Still, the majority of changes here are reworks of existing code to
    make it more straightforward or to prepare it for implementing new
    features on top of it. The primary example is the rework of ACPI
    resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with
    support for IOAPIC hotplug implemented on top of it, but there is
    quite a number of changes of this kind in the cpufreq core, ACPICA,
    ACPI EC driver, ACPI processor driver and the generic power domains
    core code too.

    The most active developer is Viresh Kumar with his cpufreq changes.

    Specifics:

    - Rework of the core ACPI resources parsing code to fix issues in it
    and make using resource offsets more convenient and consolidation
    of some resource-handing code in a couple of places that have grown
    analagous data structures and code to cover the the same gap in the
    core (Jiang Liu, Thomas Gleixner, Lv Zheng).

    - ACPI-based IOAPIC hotplug support on top of the resources handling
    rework (Jiang Liu, Yinghai Lu).

    - ACPICA update to upstream release 20150204 including an interrupt
    handling rework that allows drivers to install raw handlers for
    ACPI GPEs which then become entirely responsible for the given GPE
    and the ACPICA core code won't touch it (Lv Zheng, David E Box,
    Octavian Purdila).

    - ACPI EC driver rework to fix several concurrency issues and other
    problems related to events handling on top of the ACPICA's new
    support for raw GPE handlers (Lv Zheng).

    - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power
    Subsystem) driver for Intel chips (Ken Xue).

    - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko
    Nikula).

    - Two new blacklist entries for machines (Samsung 730U3E/740U3E and
    510R) where the native backlight interface doesn't work correctly
    while the ACPI one does (Hans de Goede).

    - Rework of the ACPI processor driver's handling of idle states to
    make the code more straightforward and less bloated overall (Rafael
    J Wysocki).

    - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht,
    Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei
    Bai).

    - PCI core power management modification to avoid resuming (some)
    runtime-suspended devices during system suspend if they are in the
    right states already (Rafael J Wysocki).

    - New SFI-based cpufreq driver for Intel platforms using SFI
    (Srinidhi Kasagar).

    - cpufreq core fixes, cleanups and simplifications (Viresh Kumar,
    Doug Anderson, Wolfram Sang).

    - SkyLake CPU support and other updates for the intel_pstate driver
    (Kristen Carlson Accardi, Srinivas Pandruvada).

    - cpufreq-dt driver cleanup (Markus Elfring).

    - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla).

    - Generic power domains core code fixes and cleanups (Ulf Hansson).

    - Operating Performance Points (OPP) core code cleanups and kernel
    documentation update (Nishanth Menon).

    - New dabugfs interface to make the list of PM QoS constraints
    available to user space (Nishanth Menon).

    - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso).

    - New devfreq class (devfreq_event) to provide raw utilization data
    to devfreq governors (Chanwoo Choi).

    - Assorted minor fixes and cleanups related to power management
    (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel
    Machek, Todd E Brandt, Wonhong Kwon).

    - turbostat updates (Len Brown) and cpupower Makefile improvement
    (Sriram Raghunathan)"

    * tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits)
    tools/power turbostat: relax dependency on APERF_MSR
    tools/power turbostat: relax dependency on invariant TSC
    Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
    tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
    tools/power turbostat: relax dependency on root permission
    ACPI / video: Add disable_native_backlight quirk for Samsung 510R
    ACPI / PM: Remove unneeded nested #ifdef
    USB / PM: Remove unneeded #ifdef and associated dead code
    intel_pstate: provide option to only use intel_pstate with HWP
    ACPI / EC: Add GPE reference counting debugging messages
    ACPI / EC: Add query flushing support
    ACPI / EC: Refine command storm prevention support
    ACPI / EC: Add command flushing support.
    ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
    ACPI: add AMD ACPI2Platform device support for x86 system
    ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()
    ACPI / EC: Update revision due to raw handler mode.
    ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
    ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
    ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
    ...

    Linus Torvalds
     

10 Feb, 2015

1 commit

  • * pm-sleep:
    PM / hibernate: exclude freed pages from allocated pages printout
    PM / sleep: export suspend_resume trace event
    PM / sleep: Mention async suspend in PM_TRACE documentation
    PM / hibernate: Remove unused function

    * pm-runtime:
    ACPI / PM: Remove unneeded nested #ifdef
    USB / PM: Remove unneeded #ifdef and associated dead code

    Rafael J. Wysocki
     

04 Feb, 2015

1 commit


24 Jan, 2015

2 commits

  • Remove the function get_safe_write_buffer() that is not used anywhere.

    This was partially found by using a static code analysis program called cppcheck.

    Signed-off-by: Rickard Strandqvist
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Rickard Strandqvist
     
  • PM QoS requests are notoriously hard to debug and made even
    more so due to their highly dynamic nature. Having visibility
    into the internal data representation per constraint allows
    us to have much better appreciation of potential issues or
    bad usage by drivers in the system.

    So introduce for all classes of PM QoS, an entry in
    /sys/kernel/debug/pm_qos that shall show all the current
    requests as well as the snapshot of the value these requests
    boil down to. For example:
    ==> /sys/kernel/debug/pm_qos/cpu_dma_latency /sys/kernel/debug/pm_qos/memory_bandwidth
    Signed-off-by: Dave Gerlach
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

07 Jan, 2015

1 commit

  • SRCU is not necessary to be compiled by default in all cases. For tinification
    efforts not compiling SRCU unless necessary is desirable.

    The current patch tries to make compiling SRCU optional by introducing a new
    Kconfig option CONFIG_SRCU which is selected when any of the components making
    use of SRCU are selected.

    If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.

    text data bss dec hex filename
    2007 0 0 2007 7d7 kernel/rcu/srcu.o

    Size of arch/powerpc/boot/zImage changes from

    text data bss dec hex filename
    831552 64180 23944 919676 e087c arch/powerpc/boot/zImage : before
    829504 64180 23952 917636 e0084 arch/powerpc/boot/zImage : after

    so the savings are about ~2000 bytes.

    Signed-off-by: Pranith Kumar
    CC: Paul E. McKenney
    CC: Josh Triplett
    CC: Lai Jiangshan
    Signed-off-by: Paul E. McKenney
    [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]

    Pranith Kumar
     

20 Dec, 2014

1 commit

  • Having switched over all of the users of CONFIG_PM_RUNTIME to use
    CONFIG_PM directly, turn the latter into a user-selectable option
    and drop the former entirely from the tree.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Ulf Hansson
    Acked-by: Kevin Hilman

    Rafael J. Wysocki
     

09 Dec, 2014

2 commits

  • * pm-runtime: (25 commits)
    i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c
    dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME
    MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    hwrandom / exynos / PM: Use CONFIG_PM in #ifdef
    block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    USB / PM: Drop CONFIG_PM_RUNTIME from the USB core
    PM: Merge the SET*_RUNTIME_PM_OPS() macros
    PM / Kconfig: Do not select PM directly from Kconfig files
    PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
    ...

    Rafael J. Wysocki
     
  • * pm-domains:
    ARM: shmobile: Convert to genpd flags for PM clocks for R-mobile
    ARM: shmobile: Convert to genpd flags for PM clocks for r8a7779
    PM / Domains: Initial PM clock support for genpd
    PM / Domains: Power on the PM domain right after attach completes
    PM / Domains: Move struct pm_domain_data to pm_domain.h
    PM / Domains: Extract code to power off/on a PM domain
    PM / Domains: Make genpd parameter of pm_genpd_present() const

    * pm-sleep:
    PM / hibernate: Deletion of an unnecessary check before the function call "vfree"
    PM / Hibernate: Migrate to ktime_t

    * pm-tools:
    tools: cpupower: fix return checks for sysfs_get_idlestate_count()

    Rafael J. Wysocki
     

04 Dec, 2014

1 commit

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so quite a few
    depend on CONFIG_PM or even may be dropped entirely in some cases.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM in the PM core code.

    Reviewed-by: Ulf Hansson
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

27 Nov, 2014

1 commit


19 Nov, 2014

1 commit

  • The number of and dependencies between high-level power management
    Kconfig options make life much harder than necessary. Several
    conbinations of them have to be tested and supported, even though
    some of those combinations are very rarely used in practice (if
    they are used in practice at all). Moreover, the fact that we
    have separate independent Kconfig options for runtime PM and
    system suspend is a serious obstacle for integration between
    the two frameworks.

    To overcome these difficulties, always select PM_RUNTIME if PM_SLEEP
    is set. Among other things, this will allow system suspend callbacks
    provided by bus types and device drivers to rely on the runtime PM
    framework regardless of the kernel configuration.

    Enthusiastically-acked-by: Kevin Hilman
    Tested-by: Geert Uytterhoeven
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

18 Nov, 2014

3 commits


15 Nov, 2014

1 commit

  • The IA64_HP_SIM dependency on PM_RUNTIME should be done in the arch
    Kconfig instead of in the PM core. Move it accordingly.

    NOTE: arch/ia64/Kconfig currently does a 'select PM', which since
    commit 1eb208aea317 (PM: Make CONFIG_PM depend on (CONFIG_PM_SLEEP ||
    CONFIG_PM_RUNTIME)) is effectively a noop unless PM_SLEEP or
    PM_RUNTIME are set elsewhere.

    Signed-off-by: Kevin Hilman
    Reviewed-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Kevin Hilman
     

09 Nov, 2014

1 commit


03 Nov, 2014

1 commit

  • This patch migrates swsusp_show_speed and its callers to using ktime_t instead
    of 'struct timeval' which suffers from the y2038 problem.

    Changes to swsusp_show_speed:
    - use ktime_t for start and stop times
    - pass start and stop times by value
    Calling functions affected:
    - load_image
    - load_image_lzo
    - save_image
    - save_image_lzo
    - hibernate_preallocate_memory
    Design decisions:
    - use ktime_t to preserve same granularity of reporting as before
    - use centisecs logic as before to avoid 'div by zero' issues caused by
    using seconds and nanoseconds directly
    - use monotonic time (ktime_get()) since we only care about elapsed time.

    Signed-off-by: Tina Ruchandani
    Suggested-by: Arnd Bergmann
    Reviewed-by: Arnd Bergmann
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Tina Ruchandani
     

28 Oct, 2014

1 commit

  • If a device's dev_pm_ops::freeze callback fails during the QUIESCE
    phase, we don't rollback things correctly calling the thaw and complete
    callbacks. This could leave some devices in a suspended state in case of
    an error during resuming from hibernation.

    Signed-off-by: Imre Deak
    Cc: All applicable
    Signed-off-by: Rafael J. Wysocki

    Imre Deak
     

24 Oct, 2014

2 commits


23 Oct, 2014

1 commit


22 Oct, 2014

2 commits

  • as per 0c740d0afc3b (introduce for_each_thread() to replace the buggy
    while_each_thread()) get rid of do_each_thread { } while_each_thread()
    construct and replace it by a more error prone for_each_thread.

    This patch doesn't introduce any user visible change.

    Suggested-by: Oleg Nesterov
    Signed-off-by: Michal Hocko
    Signed-off-by: Rafael J. Wysocki

    Michal Hocko
     
  • PM freezer relies on having all tasks frozen by the time devices are
    getting frozen so that no task will touch them while they are getting
    frozen. But OOM killer is allowed to kill an already frozen task in
    order to handle OOM situtation. In order to protect from late wake ups
    OOM killer is disabled after all tasks are frozen. This, however, still
    keeps a window open when a killed task didn't manage to die by the time
    freeze_processes finishes.

    Reduce the race window by checking all tasks after OOM killer has been
    disabled. This is still not race free completely unfortunately because
    oom_killer_disable cannot stop an already ongoing OOM killer so a task
    might still wake up from the fridge and get killed without
    freeze_processes noticing. Full synchronization of OOM and freezer is,
    however, too heavy weight for this highly unlikely case.

    Introduce and check oom_kills counter which gets incremented early when
    the allocator enters __alloc_pages_may_oom path and only check all the
    tasks if the counter changes during the freezing attempt. The counter
    is updated so early to reduce the race window since allocator checked
    oom_killer_disabled which is set by PM-freezing code. A false positive
    will push the PM-freezer into a slow path but that is not a big deal.

    Changes since v1
    - push the re-check loop out of freeze_processes into
    check_frozen_processes and invert the condition to make the code more
    readable as per Rafael

    Fixes: f660daac474c6f (oom: thaw threads if oom killed thread is frozen before deferring)
    Cc: 3.2+ # 3.2+
    Signed-off-by: Michal Hocko
    Signed-off-by: Rafael J. Wysocki

    Michal Hocko
     

07 Oct, 2014

4 commits

  • * pm-domains: (32 commits)
    PM / Domains: Rename cpu_data to cpuidle_data
    PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h
    PM / Domains: Remove legacy API for adding devices through DT
    PM / Domains: Add genpd attach/detach callbacks
    PM / Domains: add debugfs listing of struct generic_pm_domain-s
    ACPI / PM: Convert acpi_dev_pm_detach() into a static function
    ARM: exynos: Move to generic PM domain DT bindings
    amba: Add support for attach/detach of PM domains
    spi: core: Convert to dev_pm_domain_attach|detach()
    mmc: sdio: Convert to dev_pm_domain_attach|detach()
    i2c: core: Convert to dev_pm_domain_attach|detach()
    drivercore / platform: Convert to dev_pm_domain_attach|detach()
    PM / Domains: Add APIs to attach/detach a PM domain for a device
    PM / Domains: Add generic OF-based PM domain look-up
    ACPI / PM: Assign the ->detach() callback when attaching the PM domain
    PM / Domains: Add a detach callback to the struct dev_pm_domain
    PM / domains: Spelling s/domian/domain/
    PM / domains: Keep declaration of dev_power_governors together
    PM / domains: Remove default_stop_ok() API
    drivers: sh: Leave disabling of unused PM domains to genpd
    ...

    Rafael J. Wysocki
     
  • * acpi-pm:
    ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle
    PM / sleep: Rename platform suspend/resume functions in suspend.c
    PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq()

    Rafael J. Wysocki
     
  • * pm-sleep:
    PM / hibernate: Iterate over set bits instead of PFNs in swsusp_free()
    PM / sleep: new suspend_resume trace event for console resume
    PM / sleep: Update test_suspend option documentation
    PM / sleep: Enhance test_suspend option with repeat capability
    PM / sleep: Support freeze as test_suspend option
    PM / sysfs: avoid shadowing variables

    Rafael J. Wysocki
     
  • * pm-genirq:
    PM / genirq: Document rules related to system suspend and interrupts
    PCI / PM: Make PCIe PME interrupts wake up from suspend-to-idle
    x86 / PM: Set IRQCHIP_SKIP_SET_WAKE for IOAPIC IRQ chip objects
    genirq: Simplify wakeup mechanism
    genirq: Mark wakeup sources as armed on suspend
    genirq: Create helper for flow handler entry check
    genirq: Distangle edge handler entry
    genirq: Avoid double loop on suspend
    genirq: Move MASK_ON_SUSPEND handling into suspend_device_irqs()
    genirq: Make use of pm misfeature accounting
    genirq: Add sanity checks for PM options on shared interrupt lines
    genirq: Move suspend/resume logic into irq/pm code
    PM / sleep: Mechanism for aborting system suspends unconditionally

    Rafael J. Wysocki
     

01 Oct, 2014

4 commits

  • The existing implementation of swsusp_free iterates over all
    pfns in the system and checks every bit in the two memory
    bitmaps.

    This doesn't scale very well with large numbers of pfns,
    especially when the bitmaps are not populated very densly.
    Change the algorithm to iterate over the set bits in the
    bitmaps instead to make it scale better in large memory
    configurations.

    Also add a memory_bm_clear_current() helper function that
    clears the bit for the last position returned from the
    memory bitmap.

    This new version adds a !NULL check for the memory bitmaps
    before they are walked. Not doing so causes a kernel crash
    when the bitmaps are NULL.

    Signed-off-by: Joerg Roedel
    Signed-off-by: Rafael J. Wysocki

    Joerg Roedel
     
  • 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
     
  • Subsequent change sets will add platform-related operations between
    dpm_suspend_late() and dpm_suspend_noirq() as well as between
    dpm_resume_noirq() and dpm_resume_early() in suspend_enter(), so
    export these functions for suspend_enter() to be able to call them
    separately and split the invocations of dpm_suspend_end() and
    dpm_resume_start() in there accordingly.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki