17 May, 2014

1 commit

  • Currently, some subsystems (e.g. PCI and the ACPI PM domain) have to
    resume all runtime-suspended devices during system suspend, mostly
    because those devices may need to be reprogrammed due to different
    wakeup settings for system sleep and for runtime PM.

    For some devices, though, it's OK to remain in runtime suspend
    throughout a complete system suspend/resume cycle (if the device was in
    runtime suspend at the start of the cycle). We would like to do this
    whenever possible, to avoid the overhead of extra power-up and power-down
    events.

    However, problems may arise because the device's descendants may require
    it to be at full power at various points during the cycle. Therefore the
    most straightforward way to do this safely is if the device and all its
    descendants can remain runtime suspended until the complete stage of
    system resume.

    To this end, introduce a new device PM flag, power.direct_complete
    and modify the PM core to use that flag as follows.

    If the ->prepare() callback of a device returns a positive number,
    the PM core will regard that as an indication that it may leave the
    device runtime-suspended. It will then check if the system power
    transition in progress is a suspend (and not hibernation in particular)
    and if the device is, indeed, runtime-suspended. In that case, the PM
    core will set the device's power.direct_complete flag. Otherwise it
    will clear power.direct_complete for the device and it also will later
    clear it for the device's parent (if there's one).

    Next, the PM core will not invoke the ->suspend() ->suspend_late(),
    ->suspend_irq(), ->resume_irq(), ->resume_early(), or ->resume()
    callbacks for all devices having power.direct_complete set. It
    will invoke their ->complete() callbacks, however, and those
    callbacks are then responsible for resuming the devices as
    appropriate, if necessary. For example, in some cases they may
    need to queue up runtime resume requests for the devices using
    pm_request_resume().

    Changelog partly based on an Alan Stern's description of the idea
    (http://marc.info/?l=linux-pm&m=139940466625569&w=2).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Alan Stern

    Rafael J. Wysocki
     

20 Mar, 2014

3 commits

  • * pm-runtime:
    PM / Runtime: Update runtime_idle() documentation for return value meaning

    * pm-sleep:
    PM / sleep: Correct whitespace errors in
    PM: Add missing "freeze" state
    PM / Hibernate: Spelling s/anonymouns/anonymous/
    PM / Runtime: Add missing "it" in comment
    PM / suspend: Remove unnecessary !!
    PCI / PM: Resume runtime-suspended devices later during system suspend
    ACPI / PM: Resume runtime-suspended devices later during system suspend
    PM / sleep: Set pm_generic functions to NULL for !CONFIG_PM_SLEEP
    PM: fix typo in comment
    PM / hibernate: use name_to_dev_t to parse resume
    PM / wakeup: Include appropriate header file in kernel/power/wakelock.c
    PM / sleep: Move prototype declaration to header file kernel/power/power.h
    PM / sleep: Asynchronous threads for suspend_late
    PM / sleep: Asynchronous threads for suspend_noirq
    PM / sleep: Asynchronous threads for resume_early
    PM / sleep: Asynchronous threads for resume_noirq
    PM / sleep: Two flags for async suspend_noirq and suspend_late

    Rafael J. Wysocki
     
  • rjw> Why exactly are they errors?
    Geert> checkpatch.pl says: "WARNING: please, no space before tabs",
    Vim (with "let c_space_errors=1") shows them in red.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Rafael J. Wysocki

    Geert Uytterhoeven
     
  • As of commit 45f0a85c8258 ('PM / Runtime: Rework the "runtime idle"
    helper routine'), the return value of ->runtime_idle() is no longer
    ignored by the PM core, but used to decide whether to suspend the
    device or not.

    Update the documentation to match the code.

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Geert Uytterhoeven
     

01 Mar, 2014

2 commits


20 Feb, 2014

1 commit


11 Feb, 2014

1 commit

  • Add a new latency tolerance device PM QoS type to be use for
    specifying active state (RPM_ACTIVE) memory access (DMA) latency
    tolerance requirements for devices. It may be used to prevent
    hardware from choosing overly aggressive energy-saving operation
    modes (causing too much latency to appear) for the whole platform.

    This feature reqiures hardware support, so it only will be
    available for devices having a new .set_latency_tolerance()
    callback in struct dev_pm_info populated, in which case the
    routine pointed to by it should implement whatever is necessary
    to transfer the effective requirement value to the hardware.

    Whenever the effective latency tolerance changes for the device,
    its .set_latency_tolerance() callback will be executed and the
    effective value will be passed to it. If that value is negative,
    which means that the list of latency tolerance requirements for
    the device is empty, the callback is expected to switch the
    underlying hardware latency tolerance control mechanism to an
    autonomous mode if available. If that value is PM_QOS_LATENCY_ANY,
    in turn, and the hardware supports a special "no requirement"
    setting, the callback is expected to use it. That allows software
    to prevent the hardware from automatically updating the device's
    latency tolerance in response to its power state changes (e.g. during
    transitions from D3cold to D0), which generally may be done in the
    autonomous latency tolerance control mode.

    If .set_latency_tolerance() is present for the device, a new
    pm_qos_latency_tolerance_us attribute will be present in the
    devivce's power directory in sysfs. Then, user space can use
    that attribute to specify its latency tolerance requirement for
    the device, if any. Writing "any" to it means "no requirement, but
    do not let the hardware control latency tolerance" and writing
    "auto" to it allows the hardware to be switched to the autonomous
    mode if there are no other requirements from the kernel side in the
    device's list.

    This changeset includes a fix from Mika Westerberg.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

13 Jan, 2014

1 commit

  • * pm-sleep:
    PM / hibernate: Call platform_leave() in suspend path too
    PM / Sleep: Add macro to define common late/early system PM callbacks
    PM / hibernate: export hibernation_set_ops

    * pm-runtime:
    PM / Runtime: Implement the pm_generic_runtime functions for CONFIG_PM
    PM / Runtime: Add second macro for definition of runtime PM callbacks

    * pm-apm:
    apm-emulation: add hibernation APM events to support suspend2disk

    Rafael J. Wysocki
     

22 Dec, 2013

2 commits

  • By having the runtime PM callbacks implemented for CONFIG_PM, these
    becomes available in all combinations of CONFIG_PM_SLEEP and
    CONFIG_PM_RUNTIME.

    The benefit using this, is that we don't need to implement the wrapper
    functions which handles runtime PM resourses, typically called from
    both runtime PM and system PM callbacks. Instead the runtime PM
    callbacks can be invoked directly from system PM callbacks, which is
    useful for some drivers, subsystems and power domains.

    Use the new macro SET_PM_RUNTIME_PM_OPS in cases were the above makes
    sense. Make sure the callbacks are encapsulated within CONFIG_PM
    instead of CONFIG_PM_RUNTIME.

    Do note that the old macro SET_RUNTIME_PM_OPS, which is being quite
    widely used right now, requires the callbacks to be defined for
    CONFIG_PM_RUNTIME. In many cases it will certainly be convenient to
    convert to the new macro above, but that will have to be distinguished
    in case by case.

    Cc: Kevin Hilman
    Cc: Alan Stern
    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • We use the same approach as for the existing SET_SYSTEM_SLEEP_PM_OPS,
    but for the late and early callbacks instead.

    The new SET_LATE_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
    point ->suspend_late, ->freeze_late and ->poweroff_late to the same
    function. Vice verse happens for ->resume_early, ->thaw_early and
    ->restore_early.

    Cc: Kevin Hilman
    Cc: Alan Stern
    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     

19 Mar, 2013

1 commit

  • Backmerge so that I can merge Imre Deak's coalesced sg entries fixes,
    which depend upon the new for_each_sg_page introduce in

    commit a321e91b6d73ed011ffceed384c40d2785cf723b
    Author: Imre Deak
    Date: Wed Feb 27 17:02:56 2013 -0800

    lib/scatterlist: add simple page iterator

    The merge itself is just two trivial conflicts:

    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

24 Feb, 2013

1 commit

  • Introduce the flag memalloc_noio in 'struct dev_pm_info' to help PM core
    to teach mm not allocating memory with GFP_KERNEL flag for avoiding
    probable deadlock.

    As explained in the comment, any GFP_KERNEL allocation inside
    runtime_resume() or runtime_suspend() on any one of device in the path
    from one block or network device to the root device in the device tree
    may cause deadlock, the introduced pm_runtime_set_memalloc_noio() sets
    or clears the flag on device in the path recursively.

    Signed-off-by: Ming Lei
    Cc: Minchan Kim
    Cc: Alan Stern
    Cc: Oliver Neukum
    Cc: Jiri Kosina
    Cc: Mel Gorman
    Cc: KAMEZAWA Hiroyuki
    Cc: Michal Hocko
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: Greg KH
    Cc: Jens Axboe
    Cc: "David S. Miller"
    Cc: Eric Dumazet
    Cc: David Decotigny
    Cc: Tom Herbert
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ming Lei
     

20 Feb, 2013

1 commit

  • KMS drivers can potentially restore the display configuration without
    userspace help. Such drivers can can call a new funciton,
    pm_vt_switch_required(false) if they support this feature. In that
    case, the PM layer won't VT switch to the suspend console at suspend
    time and then back to the original VT on resume, but rather leave things
    alone for a nicer looking suspend and resume sequence.

    v2: make a function so we can handle multiple drivers (Alan)
    v3: use a list to track device requests (Rafael)
    v4: Squash in build fix from Jesse for CONFIG_VT_CONSOLE_SLEEP=n
    v5: Squash in patch from Wu Fengguang to add a few missing static
    qualifiers.
    v6: Add missing EXPORT_SYMBOL.

    Signed-off-by: Jesse Barnes
    Reviewed-by: Rafael J. Wysocki (v3)
    Signed-off-by: Daniel Vetter

    Jesse Barnes
     

18 Feb, 2013

1 commit

  • pm_idle appears in no generic Linux code,
    it appears only in architecture-specific code.

    Thus, pm_idle should not be declared in pm.h.

    Architectures that use an idle function pointer
    should delcare one local to their architecture,
    and/or use cpuidle.

    Signed-off-by: Len Brown
    Reviewed-by: Kevin Hilman
    Tested-by: Kevin Hilman
    Cc: linux-pm@vger.kernel.org

    Len Brown
     

24 Oct, 2012

1 commit

  • Define two device PM QoS flags, PM_QOS_FLAG_NO_POWER_OFF
    and PM_QOS_FLAG_REMOTE_WAKEUP, and introduce routines
    dev_pm_qos_expose_flags() and dev_pm_qos_hide_flags() allowing the
    caller to expose those two flags to user space or to hide them
    from it, respectively.

    After the flags have been exposed, user space will see two
    additional sysfs attributes, pm_qos_no_power_off and
    pm_qos_remote_wakeup, under the device's /sys/devices/.../power/
    directory. Then, writing 1 to one of them will update the
    PM QoS flags request owned by user space so that the corresponding
    flag is requested to be set. In turn, writing 0 to one of them
    will cause the corresponding flag in the user space's request to
    be cleared (however, the owners of the other PM QoS flags requests
    for the same device may still request the flag to be set and it
    may be effectively set even if user space doesn't request that).

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Jean Pihet
    Acked-by: mark gross

    Rafael J. Wysocki
     

23 Oct, 2012

1 commit

  • Currently struct dev_pm_info contains only one PM QoS constraints
    pointer reserved for latency requirements. Since one more device
    constraints type (i.e. flags) will be necessary, introduce a new
    structure, struct dev_pm_qos, that eventually will contain all of
    the available device PM QoS constraints and replace the "constraints"
    pointer in struct dev_pm_info with a pointer to the new structure
    called "qos".

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Jean Pihet

    Rafael J. Wysocki
     

03 Oct, 2012

1 commit

  • Pull power management updates from Rafael J Wysocki:

    - Improved system suspend/resume and runtime PM handling for the SH
    TMU, CMT and MTU2 clock event devices (also used by ARM/shmobile).

    - Generic PM domains framework extensions related to cpuidle support
    and domain objects lookup using names.

    - ARM/shmobile power management updates including improved support for
    the SH7372's A4S power domain containing the CPU core.

    - cpufreq changes related to AMD CPUs support from Matthew Garrett,
    Andre Przywara and Borislav Petkov.

    - cpu0 cpufreq driver from Shawn Guo.

    - cpufreq governor fixes related to the relaxing of limit from Michal
    Pecio.

    - OMAP cpufreq updates from Axel Lin and Richard Zhao.

    - cpuidle ladder governor fixes related to the disabling of states from
    Carsten Emde and me.

    - Runtime PM core updates related to the interactions with the system
    suspend core from Alan Stern and Kevin Hilman.

    - Wakeup sources modification allowing more helper functions to be
    called from interrupt context from John Stultz and additional
    diagnostic code from Todd Poynor.

    - System suspend error code path fix from Feng Hong.

    Fixed up conflicts in cpufreq/powernow-k8 that stemmed from the
    workqueue fixes conflicting fairly badly with the removal of support for
    hardware P-state chips. The changes were independent but somewhat
    intertwined.

    * tag 'pm-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
    Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code"
    PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2
    cpuidle: rename function name "__cpuidle_register_driver", v2
    cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name
    cpuidle: remove some empty lines
    PM: Prevent runtime suspend during system resume
    PM QoS: Use spinlock in the per-device PM QoS constraints code
    PM / Sleep: use resume event when call dpm_resume_early
    cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure
    ACPI / processor: remove pointless variable initialization
    ACPI / processor: remove unused function parameter
    cpufreq: OMAP: remove loops_per_jiffy recalculate for smp
    sections: fix section conflicts in drivers/cpufreq
    cpufreq: conservative: update frequency when limits are relaxed
    cpufreq / ondemand: update frequency when limits are relaxed
    properly __init-annotate pm_sysrq_init()
    cpufreq: Add a generic cpufreq-cpu0 driver
    PM / OPP: Initialize OPP table from device tree
    ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp
    cpufreq: Remove support for hardware P-state chips from powernow-k8
    ...

    Linus Torvalds
     

04 Sep, 2012

3 commits

  • The syscore device PM flag used to mark the devices (belonging to
    PM domains) that should never be turned off, except for the system
    core (syscore) suspend/hibernation and resume stages, need not be
    accessed by the runtime PM core functions, because all of the devices
    it is set for need to be marked as "irq safe" anyway and are
    protected from being turned off by runtime PM by ensuring that their
    usage counters are always set.

    For this reason, make the syscore flag system-wide PM-specific
    and simplify the code used for manipulating it, because it need not
    acquire the device's power.lock any more.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The syscore device PM flag is used to mark the devices (belonging to
    a PM domain) that should never be turned off, except for the system
    core (syscore) suspend/hibernation and resume stages. That flag is
    stored in the device's struct pm_subsys_data object whose address is
    available from struct device. However, in some situations it may be
    convenient to set that flag before the device is added to a PM
    domain, so it is better to move it directly to the "power" member of
    struct device. Then, it can be checked by the routines in
    drivers/base/power/runtime.c and drivers/base/power/main.c, which is
    more straightforward.

    This also reduces the number of dev_gpd_data() invocations in the
    generic PM domains framework, so the overhead related to the syscore
    flag is slightly smaller.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • Runtime PM helper functions, like pm_runtime_get_sync(), cannot be
    called by early platform device drivers, because the devices' power
    management locks are not initialized at that time. This is quite
    inconvenient, so modify early_platform_add_devices() to initialize
    the devices power management locks as appropriate and make sure that
    they won't be initialized more than once if an early platform
    device is going to be used as a regular one later.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

17 Aug, 2012

1 commit

  • dpm_list and its pm lock provide a good way to iterate all
    devices in system. Except this way, there is no other easy
    way to iterate devices in system.

    firmware loader need to cache firmware images for devices
    before system sleep, so introduce the function to meet its
    demand.

    Reported-by: Fengguang Wu
    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

02 May, 2012

1 commit

  • After the previous changes in default_stop_ok() and
    default_power_down_ok() for PM domains, there are two fields in
    struct dev_pm_info that aren't necessary any more, suspend_time
    and max_time_suspended_ns.

    Remove those fields along with all of the code that accesses them,
    which simplifies the runtime PM framework quite a bit.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

17 Mar, 2012

1 commit


14 Mar, 2012

1 commit

  • A runtime suspend of a device (e.g. an MMC controller) belonging to
    a power domain or, in a more complicated scenario, a runtime suspend
    of another device in the same power domain, may cause power to be
    removed from the entire domain. In that case, the amount of time
    necessary to runtime-resume the given device (e.g. the MMC
    controller) is often substantially greater than the time needed to
    run its driver's runtime resume callback. That may hurt performance
    in some situations, because user data may need to wait for the
    device to become operational, so we should make it possible to
    prevent that from happening.

    For this reason, introduce a new sysfs attribute for devices,
    power/pm_qos_resume_latency_us, allowing user space to specify the
    upper bound of the time necessary to bring the (runtime-suspended)
    device up after the resume of it has been requested. However, make
    that attribute appear only for the devices whose drivers declare
    support for it by calling the (new) dev_pm_qos_expose_latency_limit()
    helper function with the appropriate initial value of the attribute.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Kevin Hilman
    Reviewed-by: Mark Brown
    Acked-by: Linus Walleij

    Rafael J. Wysocki
     

18 Feb, 2012

1 commit

  • The UNIVERSAL_DEV_PM_OPS() macro is slightly misleading, because it
    may suggest that it's a good idea to point runtime PM callback
    pointers to the same routines as system suspend/resume callbacks
    .suspend() and .resume(), which is not the case. For this reason,
    add a comment to include/linux/pm.h, next to the definition of
    UNIVERSAL_DEV_PM_OPS(), describing how device PM callbacks are
    related to each other.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

30 Jan, 2012

2 commits

  • Introduce generic subsystem callbacks for the new phases of device
    suspend/resume during system power transitions: "late suspend",
    "early resume", "late freeze", "early thaw", "late poweroff",
    "early restore".

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The current device suspend/resume phases during system-wide power
    transitions appear to be insufficient for some platforms that want
    to use the same callback routines for saving device states and
    related operations during runtime suspend/resume as well as during
    system suspend/resume. In principle, they could point their
    .suspend_noirq() and .resume_noirq() to the same callback routines
    as their .runtime_suspend() and .runtime_resume(), respectively,
    but at least some of them require device interrupts to be enabled
    while the code in those routines is running.

    It also makes sense to have device suspend-resume callbacks that will
    be executed with runtime PM disabled and with device interrupts
    enabled in case someone needs to run some special code in that
    context during system-wide power transitions.

    Apart from this, .suspend_noirq() and .resume_noirq() were introduced
    as a workaround for drivers using shared interrupts and failing to
    prevent their interrupt handlers from accessing suspended hardware.
    It appears to be better not to use them for other porposes, or we may
    have to deal with some serious confusion (which seems to be happening
    already).

    For the above reasons, introduce new device suspend/resume phases,
    "late suspend" and "early resume" (and analogously for hibernation)
    whose callback will be executed with runtime PM disabled and with
    device interrupts enabled and whose callback pointers generally may
    point to runtime suspend/resume routines.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Mark Brown
    Reviewed-by: Kevin Hilman

    Rafael J. Wysocki
     

26 Dec, 2011

1 commit


22 Dec, 2011

1 commit

  • Since the PM core is now going to execute driver callbacks directly
    if the corresponding subsystem callbacks are not present,
    forward-only subsystem callbacks (i.e. such that only execute the
    corresponding driver callbacks) are not necessary any more. Thus
    it is possible to remove generic_subsys_pm_ops, because the only
    callback in there that is not forward-only, .runtime_idle, is not
    really used by the only user of generic_subsys_pm_ops, which is
    vio_bus_type.

    However, the generic callback routines themselves cannot be removed
    from generic_ops.c, because they are used individually by a number
    of subsystems.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

02 Dec, 2011

1 commit

  • Make the runtime PM core use device PM QoS constraints to check if
    it is allowed to suspend a given device, so that an error code is
    returned if the device's own PM QoS constraint is negative or one of
    its children has already been suspended for too long. If this is
    not the case, the maximum estimated time the device is allowed to be
    suspended, computed as the minimum of the device's PM QoS constraint
    and the PM QoS constraints of its children (reduced by the difference
    between the current time and their suspend times) is stored in a new
    device's PM field power.max_time_suspended_ns that can be used by
    the device's subsystem or PM domain to decide whether or not to put
    the device into lower-power (and presumably higher-latency) states
    later (if the constraint is 0, which means "no constraint", the
    power.max_time_suspended_ns is set to -1).

    Additionally, the time of execution of the subsystem-level
    .runtime_suspend() callback for the device is recorded in the new
    power.suspend_time field for later use by the device's subsystem or
    PM domain along with power.max_time_suspended_ns (it also is used
    by the core code when the device's parent is suspended).

    Introduce a new helper function,
    pm_runtime_update_max_time_suspended(), allowing subsystems and PM
    domains (or device drivers) to update the power.max_time_suspended_ns
    field, for example after changing the power state of a suspended
    device.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

29 Nov, 2011

1 commit


18 Nov, 2011

1 commit

  • Commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c (PM / Sleep: Mark
    devices involved in wakeup signaling during suspend) introduced
    the power.wakeup_path field in struct dev_pm_info to mark devices
    whose children are enabled to wake up the system from sleep states,
    so that power domains containing the parents that provide their
    children with wakeup power and/or relay their wakeup signals are not
    turned off. Unfortunately, that introduced a PM regression on SH7372
    whose power consumption in the system "memory sleep" state increased
    as a result of it, because it prevented the power domain containing
    the I2C controller from being turned off when some children of that
    controller were enabled to wake up the system, although the
    controller was not necessary for them to signal wakeup.

    To fix this issue use the observation that devices whose
    power.ignore_children flag is set for runtime PM should be treated
    analogously during system suspend. Namely, they shouldn't be
    included in wakeup paths going through their children. Since the
    SH7372 I2C controller's power.ignore_children flag is set, doing so
    will restore the previous behavior of that SOC.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

22 Oct, 2011

2 commits

  • * pm-domains:
    ARM: mach-shmobile: sh7372 A4R support (v4)
    ARM: mach-shmobile: sh7372 A3SP support (v4)
    PM / Sleep: Mark devices involved in wakeup signaling during suspend

    Rafael J. Wysocki
     
  • The generic PM domains code in drivers/base/power/domain.c has
    to avoid powering off domains that provide power to wakeup devices
    during system suspend. Currently, however, this only works for
    wakeup devices directly belonging to the given domain and not for
    their children (or the children of their children and so on).
    Thus, if there's a wakeup device whose parent belongs to a power
    domain handled by the generic PM domains code, the domain will be
    powered off during system suspend preventing the device from
    signaling wakeup.

    To address this problem introduce a device flag, power.wakeup_path,
    that will be set during system suspend for all wakeup devices,
    their parents, the parents of their parents and so on. This way,
    all wakeup paths in the device hierarchy will be marked and the
    generic PM domains code will only need to avoid powering off
    domains containing devices whose power.wakeup_path is set.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

08 Oct, 2011

2 commits

  • * pm-qos:
    PM / QoS: Update Documentation for the pm_qos and dev_pm_qos frameworks
    PM / QoS: Add function dev_pm_qos_read_value() (v3)
    PM QoS: Add global notification mechanism for device constraints
    PM QoS: Implement per-device PM QoS constraints
    PM QoS: Generalize and export constraints management code
    PM QoS: Reorganize data structs
    PM QoS: Code reorganization
    PM QoS: Minor clean-ups
    PM QoS: Move and rename the implementation files

    Rafael J. Wysocki
     
  • * pm-domains:
    PM / Domains: Split device PM domain data into base and need_restore
    ARM: mach-shmobile: sh7372 sleep warning fixes
    ARM: mach-shmobile: sh7372 A3SM support
    ARM: mach-shmobile: sh7372 generic suspend/resume support
    PM / Domains: Preliminary support for devices with power.irq_safe set
    PM: Move clock-related definitions and headers to separate file
    PM / Domains: Use power.sybsys_data to reduce overhead
    PM: Reference counting of power.subsys_data
    PM: Introduce struct pm_subsys_data
    ARM / shmobile: Make A3RV be a subdomain of A4LC on SH7372
    PM / Domains: Rename argument of pm_genpd_add_subdomain()
    PM / Domains: Rename GPD_STATE_WAIT_PARENT to GPD_STATE_WAIT_MASTER
    PM / Domains: Allow generic PM domains to have multiple masters
    PM / Domains: Add "wait for parent" status for generic PM domains
    PM / Domains: Make pm_genpd_poweron() always survive parent removal
    PM / Domains: Do not take parent locks to modify subdomain counters
    PM / Domains: Implement subdomain counters as atomic fields

    Rafael J. Wysocki
     

05 Oct, 2011

1 commit

  • To read the current PM QoS value for a given device we need to
    make sure that the device's power.constraints object won't be
    removed while we're doing that. For this reason, put the
    operation under dev->power.lock and acquire the lock
    around the initialization and removal of power.constraints.

    Moreover, since we're using the value of power.constraints to
    determine whether or not the object is present, the
    power.constraints_state field isn't necessary any more and may be
    removed. However, dev_pm_qos_add_request() needs to check if the
    device is being removed from the system before allocating a new
    PM QoS constraints object for it, so make it use the
    power.power_state field of struct device for this purpose.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

27 Sep, 2011

1 commit

  • The struct pm_domain_data data type is defined in such a way that
    adding new fields specific to the generic PM domains code will
    require include/linux/pm.h to be modified. As a result, data types
    used only by the generic PM domains code will be defined in two
    headers, although they all should be defined in pm_domain.h and
    pm.h will need to include more headers, which won't be very nice.

    For this reason change the definition of struct pm_subsys_data
    so that its domain_data member is a pointer, which will allow
    struct pm_domain_data to be subclassed by various PM domains
    implementations. Remove the need_restore member from
    struct pm_domain_data and make the generic PM domains code
    subclass it by adding the need_restore member to the new data type.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

25 Aug, 2011

1 commit

  • Implement the per-device PM QoS constraints by creating a device
    PM QoS API, which calls the PM QoS constraints management core code.

    The per-device latency constraints data strctures are stored
    in the device dev_pm_info struct.

    The device PM code calls the init and destroy of the per-device constraints
    data struct in order to support the dynamic insertion and removal of the
    devices in the system.

    To minimize the data usage by the per-device constraints, the data struct
    is only allocated at the first call to dev_pm_qos_add_request.
    The data is later free'd when the device is removed from the system.
    A global mutex protects the constraints users from the data being
    allocated and free'd.

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet