29 Nov, 2011

4 commits


05 Nov, 2011

2 commits

  • Originally, the runtime PM core would send an idle notification
    whenever a suspend attempt failed. The idle callback routine could
    then schedule a delayed suspend for some time later.

    However this behavior was changed by commit
    f71648d73c1650b8b4aceb3856bebbde6daa3b86 (PM / Runtime: Remove idle
    notification after failing suspend). No notifications were sent, and
    there was no clear mechanism to retry failed suspends.

    This caused problems for the usbhid driver, because it fails
    autosuspend attempts as long as a key is being held down. Therefore
    this patch (as1492) adds a mechanism for retrying failed
    autosuspends. If the callback routine updates the last_busy field so
    that the next autosuspend expiration time is in the future, the
    autosuspend will automatically be rescheduled.

    Signed-off-by: Alan Stern
    Tested-by: Henrik Rydberg
    Cc:
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • This patch:
    * Substitutes some obsolete references to kernel/power/process.c by
    kernel/freezer.c.
    * Mentions kernel/freezer.c as being part of the "freezer" code along
    with the rest of the files.
    * Fixes a trivial typo.

    Signed-off-by: Srivatsa S. Bhat
    Signed-off-by: Rafael J. Wysocki

    Srivatsa S. Bhat
     

02 Nov, 2011

1 commit

  • * 'for-linus' of git://opensource.wolfsonmicro.com/regulator: (22 commits)
    regulator: Constify constraints name
    regulator: Fix possible nullpointer dereference in regulator_enable()
    regulator: gpio-regulator add dependency on GENERIC_GPIO
    regulator: Add module.h include to gpio-regulator
    regulator: Add driver for gpio-controlled regulators
    regulator: remove duplicate REG_CTRL2 defines in tps65023
    regulator: Clarify documentation for regulator-regulator supplies
    regulator: Fix some bitrot in the machine driver documentation
    regulator: tps65023: Added support for the similiar TPS65020 chip
    regulator: tps65023: Setting correct core regulator for tps65021
    regulator: tps65023: Set missing bit for update core-voltage
    regulator: tps65023: Fixes i2c configuration issues
    regulator: Add debugfs file showing the supply map table
    regulator: tps6586x: add SMx slew rate setting
    regulator: tps65023: Fixes i2c configuration issues
    regulator: tps6507x: Remove num_voltages array
    regulator: max8952: removed unused mutex.
    regulator: fix regulator/consumer.h kernel-doc warning
    regulator: Ensure enough enable time for max8649
    regulator: 88pm8607: Fix off-by-one value range checking in the case of no id is matched
    ...

    Linus Torvalds
     

25 Oct, 2011

1 commit

  • * 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits)
    PM / Clocks: Remove redundant NULL checks before kfree()
    PM / Documentation: Update docs about suspend and CPU hotplug
    ACPI / PM: Add Sony VGN-FW21E to nonvs blacklist.
    ARM: mach-shmobile: sh7372 A4R support (v4)
    ARM: mach-shmobile: sh7372 A3SP support (v4)
    PM / Sleep: Mark devices involved in wakeup signaling during suspend
    PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image
    PM / Hibernate: Do not initialize static and extern variables to 0
    PM / Freezer: Make fake_signal_wake_up() wake TASK_KILLABLE tasks too
    PM / Hibernate: Add resumedelay kernel param in addition to resumewait
    MAINTAINERS: Update linux-pm list address
    PM / ACPI: Blacklist Vaio VGN-FW520F machine known to require acpi_sleep=nonvs
    PM / ACPI: Blacklist Sony Vaio known to require acpi_sleep=nonvs
    PM / Hibernate: Add resumewait param to support MMC-like devices as resume file
    PM / Hibernate: Fix typo in a kerneldoc comment
    PM / Hibernate: Freeze kernel threads after preallocating memory
    PM: Update the policy on default wakeup settings
    PM / VT: Cleanup #if defined uglyness and fix compile error
    PM / Suspend: Off by one in pm_suspend()
    PM / Hibernate: Include storage keys in hibernation image on s390
    ...

    Linus Torvalds
     

22 Oct, 2011

1 commit

  • Update the documentation about the interaction between the suspend (S3) call
    path and the CPU hotplug infrastructure.
    This patch focusses only on the activities of the freezer, cpu hotplug and
    the notifications involved. It outlines how regular CPU hotplug differs from
    the way it is invoked during suspend and also tries to explain the locking
    involved. In addition to that, it discusses the issue of microcode update
    during CPU hotplug operations.

    Signed-off-by: Srivatsa S. Bhat
    Signed-off-by: Rafael J. Wysocki

    Srivatsa S. Bhat
     

17 Oct, 2011

4 commits

  • There is a problem with the current ordering of hibernate code which
    leads to deadlocks in some filesystems' memory shrinkers. Namely,
    some filesystems use freezable kernel threads that are inactive when
    the hibernate memory preallocation is carried out. Those same
    filesystems use memory shrinkers that may be triggered by the
    hibernate memory preallocation. If those memory shrinkers wait for
    the frozen kernel threads, the hibernate process deadlocks (this
    happens with XFS, for one example).

    Apparently, it is not technically viable to redesign the filesystems
    in question to avoid the situation described above, so the only
    possible solution of this issue is to defer the freezing of kernel
    threads until the hibernate memory preallocation is done, which is
    implemented by this change.

    Unfortunately, this requires the memory preallocation to be done
    before the "prepare" stage of device freeze, so after this change the
    only way drivers can allocate additional memory for their freeze
    routines in a clean way is to use PM notifiers.

    Reported-by: Christoph
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • This patch (as1485) documents a change to the kernel's default wakeup
    policy. Devices that forward wakeup requests between buses should be
    enabled for wakeup by default.

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

    Alan Stern
     
  • Record S3 failure time about each reason and the latest two failed
    devices' names in S3 progress.
    We can check it through 'suspend_stats' entry in debugfs.

    The motivation of the patch:

    We are enabling power features on Medfield. Comparing with PC/notebook,
    a mobile enters/exits suspend-2-ram (we call it s3 on Medfield) far
    more frequently. If it can't enter suspend-2-ram in time, the power
    might be used up soon.

    We often find sometimes, a device suspend fails. Then, system retries
    s3 over and over again. As display is off, testers and developers
    don't know what happens.

    Some testers and developers complain they don't know if system
    tries suspend-2-ram, and what device fails to suspend. They need
    such info for a quick check. The patch adds suspend_stats under
    debugfs for users to check suspend to RAM statistics quickly.

    If not using this patch, we have other methods to get info about
    what device fails. One is to turn on CONFIG_PM_DEBUG, but users
    would get too much info and testers need recompile the system.

    In addition, dynamic debug is another good tool to dump debug info.
    But it still doesn't match our utilization scenario closely.
    1) user need write a user space parser to process the syslog output;
    2) Our testing scenario is we leave the mobile for at least hours.
    Then, check its status. No serial console available during the
    testing. One is because console would be suspended, and the other
    is serial console connecting with spi or HSU devices would consume
    power. These devices are powered off at suspend-2-ram.

    Signed-off-by: ShuoX Liu
    Signed-off-by: Rafael J. Wysocki

    ShuoX Liu
     
  • * pm-runtime:
    PM / Runtime: Handle .runtime_suspend() failure correctly
    PM / Runtime: Fix kerneldoc comment for rpm_suspend()
    PM / Runtime: Update document about callbacks

    Rafael J. Wysocki
     

11 Oct, 2011

1 commit

  • Support for device power domains has been introduced in
    commit 9659cc0678b954f187290c6e8b247a673c5d37e1 (PM: Make
    system-wide PM and runtime PM treat subsystems consistently),
    also power domain callbacks will take precedence over subsystem ones
    from commit 4d27e9dcff00a6425d779b065ec8892e4f391661(PM: Make
    power domain callbacks take precedence over subsystem ones).

    So update part of "Device Runtime PM Callbacks" in
    Documentation/power/runtime_pm.txt.

    Signed-off-by: Ming Lei
    Signed-off-by: Rafael J. Wysocki

    Ming Lei
     

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-runtime:
    PM / Tracing: build rpm-traces.c only if CONFIG_PM_RUNTIME is set
    PM / Runtime: Replace dev_dbg() with trace_rpm_*()
    PM / Runtime: Introduce trace points for tracing rpm_* functions
    PM / Runtime: Don't run callbacks under lock for power.irq_safe set
    USB: Add wakeup info to debugging messages
    PM / Runtime: pm_runtime_idle() can be called in atomic context
    PM / Runtime: Add macro to test for runtime PM events
    PM / Runtime: Add might_sleep() to runtime PM functions

    Rafael J. Wysocki
     

07 Oct, 2011

2 commits


05 Oct, 2011

1 commit


28 Sep, 2011

1 commit

  • There are numerous broken references to Documentation files (in other
    Documentation files, in comments, etc.). These broken references are
    caused by typo's in the references, and by renames or removals of the
    Documentation files. Some broken references are simply odd.

    Fix these broken references, sometimes by dropping the irrelevant text
    they were part of.

    Signed-off-by: Paul Bolle
    Signed-off-by: Jiri Kosina

    Paul Bolle
     

22 Sep, 2011

1 commit


25 Aug, 2011

1 commit


14 Aug, 2011

1 commit

  • Some of the entry points to pm runtime are not safe to
    call in atomic context unless pm_runtime_irq_safe() has
    been called. Inspecting the code, it is not immediately
    obvious that the functions sleep at all, as they run
    inside a spin_lock_irqsave, but under some conditions
    they can drop the lock and turn on irqs.

    If a driver incorrectly calls the pm_runtime apis, it can
    cause sleeping and irq processing when it expects to stay
    in atomic context.

    Add might_sleep_if to the majority of the __pm_runtime_* entry points
    to enforce correct usage.

    Add pm_runtime_put_sync_autosuspend to the list of
    functions that can be called in atomic context.

    Signed-off-by: Colin Cross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Colin Cross
     

06 Aug, 2011

1 commit

  • Currently the use of pm_runtime_put_sync() is not safe from
    interrupts-disabled context because rpm_idle() will release the
    spinlock and enable interrupts for the idle callbacks. This enables
    interrupts during a time where interrupts were expected to be
    disabled, and can have strange side effects on drivers that expected
    interrupts to be disabled.

    This is not a bug since the documentation clearly states that only
    _put_sync_suspend() is safe in IRQ-safe mode.

    However, pm_runtime_put_sync() could be made safe when in IRQ-safe
    mode by releasing the spinlock but not re-enabling interrupts, which
    is what this patch aims to do.

    Problem was found when using some buggy drivers that set
    pm_runtime_irq_safe() and used _put_sync() in interrupts-disabled
    context.

    Reported-by: Colin Cross
    Tested-by: Nishanth Menon
    Signed-off-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Kevin Hilman
     

16 Jul, 2011

3 commits

  • * pm-runtime:
    OMAP: PM: disable idle on suspend for GPIO and UART
    OMAP: PM: omap_device: add API to disable idle on suspend
    OMAP: PM: omap_device: add system PM methods for PM domain handling
    OMAP: PM: omap_device: conditionally use PM domain runtime helpers
    PM / Runtime: Add new helper function: pm_runtime_status_suspended()
    PM / Runtime: Consistent utilization of deferred_resume
    PM / Runtime: Prevent runtime_resume from racing with probe
    PM / Runtime: Replace "run-time" with "runtime" in documentation
    PM / Runtime: Improve documentation of enable, disable and barrier
    PM: Limit race conditions between runtime PM and system sleep (v2)
    PCI / PM: Detect early wakeup in pci_pm_prepare()
    PM / Runtime: Return special error code if runtime PM is disabled
    PM / Runtime: Update documentation of interactions with system sleep

    Rafael J. Wysocki
     
  • * pm-domains: (33 commits)
    ARM / shmobile: Return -EBUSY from A4LC power off if A3RV is active
    PM / Domains: Take .power_off() error code into account
    ARM / shmobile: Use genpd_queue_power_off_work()
    ARM / shmobile: Use pm_genpd_poweroff_unused()
    PM / Domains: Introduce function to power off all unused PM domains
    PM / Domains: Queue up power off work only if it is not pending
    PM / Domains: Improve handling of wakeup devices during system suspend
    PM / Domains: Do not restore all devices on power off error
    PM / Domains: Allow callbacks to execute all runtime PM helpers
    PM / Domains: Do not execute device callbacks under locks
    PM / Domains: Make failing pm_genpd_prepare() clean up properly
    PM / Domains: Set device state to "active" during system resume
    ARM: mach-shmobile: sh7372 A3RV requires A4LC
    PM / Domains: Export pm_genpd_poweron() in header
    ARM: mach-shmobile: sh7372 late pm domain off
    ARM: mach-shmobile: Runtime PM late init callback
    ARM: mach-shmobile: sh7372 D4 support
    ARM: mach-shmobile: sh7372 A4MP support
    ARM: mach-shmobile: sh7372: make sure that fsi is peripheral of spu2
    ARM: mach-shmobile: sh7372 A3SG support
    ...

    Rafael J. Wysocki
     
  • cpufreq table allocated by opp_init_cpufreq_table is better
    freed by OPP layer itself. This allows future modifications to
    the table handling to be transparent to the users.

    Signed-off-by: Nishanth Menon
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

12 Jul, 2011

1 commit


06 Jul, 2011

3 commits

  • The runtime PM documentation and kerneldoc comments sometimes spell
    "runtime" with a dash (i.e. "run-time"). Replace all of those
    instances with "runtime" to make the naming consistent.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The runtime PM documentation in Documentation/power/runtime_pm.txt
    doesn't say that pm_runtime_enable() and pm_runtime_disable() work by
    operating on power.disable_depth, which is wrong, because the
    possibility of nesting disables doesn't follow from the description
    of these functions. Also, there is no description of
    pm_runtime_barrier() at all in the document, which is confusing.
    Improve the documentation by fixing those issues.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • One of the roles of the PM core is to prevent different PM callbacks
    executed for the same device object from racing with each other.
    Unfortunately, after commit e8665002477f0278f84f898145b1f141ba26ee26
    (PM: Allow pm_runtime_suspend() to succeed during system suspend)
    runtime PM callbacks may be executed concurrently with system
    suspend/resume callbacks for the same device.

    The main reason for commit e8665002477f0278f84f898145b1f141ba26ee26
    was that some subsystems and device drivers wanted to use runtime PM
    helpers, pm_runtime_suspend() and pm_runtime_put_sync() in
    particular, for carrying out the suspend of devices in their
    .suspend() callbacks. However, as it's been determined recently,
    there are multiple reasons not to do so, inlcuding:

    * The caller really doesn't control the runtime PM usage counters,
    because user space can access them through sysfs and effectively
    block runtime PM. That means using pm_runtime_suspend() or
    pm_runtime_get_sync() to suspend devices during system suspend
    may or may not work.

    * If a driver calls pm_runtime_suspend() from its .suspend()
    callback, it causes the subsystem's .runtime_suspend() callback to
    be executed, which leads to the call sequence:

    subsys->suspend(dev)
    driver->suspend(dev)
    pm_runtime_suspend(dev)
    subsys->runtime_suspend(dev)

    recursive from the subsystem's point of view. For some subsystems
    that may actually work (e.g. the platform bus type), but for some
    it will fail in a rather spectacular fashion (e.g. PCI). In each
    case it means a layering violation.

    * Both the subsystem and the driver can provide .suspend_noirq()
    callbacks for system suspend that can do whatever the
    .runtime_suspend() callbacks do just fine, so it really isn't
    necessary to call pm_runtime_suspend() during system suspend.

    * The runtime PM's handling of wakeup devices is usually different
    from the system suspend's one, so .runtime_suspend() may simply be
    inappropriate for system suspend.

    * System suspend is supposed to work even if CONFIG_PM_RUNTIME is
    unset.

    * The runtime PM workqueue is frozen before system suspend, so if
    whatever the driver is going to do during system suspend depends
    on it, that simply won't work.

    Still, there is a good reason to allow pm_runtime_resume() to
    succeed during system suspend and resume (for instance, some
    subsystems and device drivers may legitimately use it to ensure that
    their devices are in full-power states before suspending them).
    Moreover, there is no reason to prevent runtime PM callbacks from
    being executed in parallel with the system suspend/resume .prepare()
    and .complete() callbacks and the code removed by commit
    e8665002477f0278f84f898145b1f141ba26ee26 went too far in this
    respect. On the other hand, runtime PM callbacks, including
    .runtime_resume(), must not be executed during system suspend's
    "late" stage of suspending devices and during system resume's "early"
    device resume stage.

    Taking all of the above into consideration, make the PM core
    acquire a runtime PM reference to every device and resume it if
    there's a runtime PM resume request pending right before executing
    the subsystem-level .suspend() callback for it. Make the PM core
    drop references to all devices right after executing the
    subsystem-level .resume() callbacks for them. Additionally,
    make the PM core disable the runtime PM framework for all devices
    during system suspend, after executing the subsystem-level .suspend()
    callbacks for them, and enable the runtime PM framework for all
    devices during system resume, right before executing the
    subsystem-level .resume() callbacks for them.

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

    Rafael J. Wysocki
     

02 Jul, 2011

6 commits

  • Some callers of pm_runtime_get_sync() and other runtime PM helper
    functions, scsi_autopm_get_host() and scsi_autopm_get_device() in
    particular, need to distinguish error codes returned when runtime PM
    is disabled (i.e. power.disable_depth is nonzero for the given
    device) from error codes returned in other situations. For this
    reason, make the runtime PM helper functions return -EACCES when
    power.disable_depth is nonzero and ensure that this error code
    won't be returned by them in any other circumstances. Modify
    scsi_autopm_get_host() and scsi_autopm_get_device() to check the
    error code returned by pm_runtime_get_sync() and ignore -EACCES.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The documents describing the interactions between runtime PM and
    system sleep generally refer to the model in which the system sleep
    state is entered through a global firmware or hardware operation.
    As a result, some recommendations given in there are not entirely
    suitable for systems in which this is not the case. Update the
    documentation to take the existence of those systems into account.

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

    Rafael J. Wysocki
     
  • Introduce generic "noirq" power management callback routines for
    subsystems in addition to the "regular" generic PM callback routines.

    The new routines will be used, among other things, for implementing
    system-wide PM transitions support for generic PM domains.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The naming convention used by commit 7538e3db6e015e890825fbd9f86599b
    (PM: Add support for device power domains), which introduced the
    struct dev_power_domain type for representing device power domains,
    evidently confuses some developers who tend to think that objects
    of this type must correspond to "power domains" as defined by
    hardware, which is not the case. Namely, at the kernel level, a
    struct dev_power_domain object can represent arbitrary set of devices
    that are mutually dependent power management-wise and need not belong
    to one hardware power domain. To avoid that confusion, rename struct
    dev_power_domain to struct dev_pm_domain and rename the related
    pointers in struct device and struct pm_clk_notifier_block from
    pwr_domain to pm_domain.

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

    Rafael J. Wysocki
     
  • Commit e1866b33b1e89f077b7132daae3dfd9a594e9a1a (PM / Runtime: Rework
    runtime PM handling during driver removal) forgot to update the
    documentation in Documentation/power/runtime_pm.txt to match the new
    code in drivers/base/dd.c. Update that documentation to match the
    code it describes.

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

    Rafael J. Wysocki
     
  • Replace reference to pm_runtime_idle_sync() in the driver core with
    pm_runtime_put_sync() which is used in the code.

    Signed-off-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Kevin Hilman
     

22 Jun, 2011

3 commits