1. 08 11月, 2014 1 次提交
  2. 28 10月, 2014 1 次提交
    • I
      PM / Sleep: fix async suspend_late/freeze_late error handling · 246ef766
      Imre Deak 提交于
      If an asynchronous suspend_late or freeze_late callback fails
      during the SUSPEND, FREEZE or QUIESCE phases, we don't propagate the
      corresponding error correctly, in effect ignoring the error and
      continuing the suspend-to-ram/hibernation. During suspend-to-ram this
      could leave some devices without a valid saved context, leading to a
      failure to reinitialize them during resume. During hibernation this
      could leave some devices active interfeering with the creation /
      restoration of the hibernation image. Also this could leave the
      corresponding devices without a valid saved context and failure to
      reinitialize them during resume.
      
      Fixes: de377b39 (PM / sleep: Asynchronous threads for suspend_late)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      246ef766
  3. 03 10月, 2014 2 次提交
  4. 01 10月, 2014 1 次提交
  5. 26 9月, 2014 2 次提交
  6. 24 9月, 2014 1 次提交
    • M
      PM / Domains: add debugfs listing of struct generic_pm_domain-s · 2bd5306a
      Maciej Matraszek 提交于
      Add /sys/kernel/debug/pm_genpd/pm_genpd_summary file, which
      lists power domains in the system, their statuses and attached devices,
      resembling /sys/kernel/debug/clk/clk_summary.
      
      Currently it is impossible to inspect (from userland) whether
      a power domain is on or off. And, if it is on, which device blocks it
      from powering down. This change allows developers working on
      embedded devices power efficiency to list all necessary information
      about generic power domains in one place.
      
      The content of pm_genpd/pm_genpd_summary file is generated by iterating
      over all generic power domain in the system, and, for each,
      over registered devices and over the subdomains, if present.
      
      Example output:
      $ cat  /sys/kernel/debug/pm_genpd/pm_genpd_summary
          domain                      status         slaves
                 /device                                      runtime status
      ----------------------------------------------------------------------
      a4su                            off
      a3sg                            off
      a3sm                            on
      a3sp                            on
          /devices/e6600000.pwm                               suspended
          /devices/e6c50000.serial                            active
          /devices/e6850000.sd                                suspended
          /devices/e6bd0000.mmc                               active
      a4s                             on               a3sp, a3sm, a3sg
          /devices/e6900000.irqpin                            unsupported
          /devices/e6900004.irqpin                            unsupported
          /devices/e6900008.irqpin                            unsupported
          /devices/e690000c.irqpin                            unsupported
          /devices/e9a00000.ethernet                          active
      a3rv                            off
      a4r                             off              a3rv
          /devices/fff20000.i2c                               suspended
      a4lc                            off
      c5                              on               a4lc, a4r, a4s, a4su
          /devices/e6050000.pfc                               unsupported
          /devices/e6138000.timer                             active
      
      To enable this feature, compile the kernel with debugfs
      and CONFIG_PM_ADVANCED_DEBUG enabled.
      Signed-off-by: NMaciej Matraszek <m.matraszek@samsung.com>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2bd5306a
  7. 22 9月, 2014 3 次提交
  8. 09 9月, 2014 9 次提交
  9. 08 9月, 2014 1 次提交
  10. 01 9月, 2014 1 次提交
  11. 29 7月, 2014 1 次提交
  12. 11 6月, 2014 1 次提交
    • T
      PM / sleep: trace events for device PM callbacks · e8bca479
      Todd E Brandt 提交于
      Adds two trace events which supply the same info that initcall_debug
      provides, but via ftrace instead of dmesg. The existing initcall_debug
      calls require the pm_print_times_enabled var to be set (either via
      sysfs or via the kernel cmd line). The new trace events provide all the
      same info as the initcall_debug prints but with less overhead, and also
      with coverage of device prepare and complete device callbacks.
      
      These events replace the device_pm_report_time event (which has been
      removed). device_pm_callback_start is called first and provides the device
      and callback info. device_pm_callback_end is called after with the
      device name and error info. The time and pid are gathered from the trace
      data headers.
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e8bca479
  13. 07 6月, 2014 1 次提交
    • T
      PM / sleep: trace events for suspend/resume · bb3632c6
      Todd E Brandt 提交于
      Adds trace events that give finer resolution into suspend/resume. These
      events are graphed in the timelines generated by the analyze_suspend.py
      script. They represent large areas of time consumed that are typical to
      suspend and resume.
      
      The event is triggered by calling the function "trace_suspend_resume"
      with three arguments: a string (the name of the event to be displayed
      in the timeline), an integer (case specific number, such as the power
      state or cpu number), and a boolean (where true is used to denote the start
      of the timeline event, and false to denote the end).
      
      The suspend_resume trace event reproduces the data that the machine_suspend
      trace event did, so the latter has been removed.
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bb3632c6
  14. 30 5月, 2014 1 次提交
  15. 27 5月, 2014 1 次提交
  16. 20 5月, 2014 1 次提交
  17. 17 5月, 2014 1 次提交
    • R
      PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily · aae4518b
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      aae4518b
  18. 07 5月, 2014 2 次提交
    • N
      PM / OPP: Move cpufreq specific OPP functions out of generic OPP library · a0dd7b79
      Nishanth Menon 提交于
      CPUFreq specific helper functions for OPP (Operating Performance Points)
      now use generic OPP functions that allow CPUFreq to be be moved back
      into CPUFreq framework. This allows for independent modifications
      or future enhancements as needed isolated to just CPUFreq framework
      alone.
      
      Here, we just move relevant code and documentation to make this part of
      CPUFreq infrastructure.
      
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a0dd7b79
    • N
      PM / OPP: Remove cpufreq wrapper dependency on internal data organization · 0f5c890e
      Nishanth Menon 提交于
      CPUFREQ custom functions for OPP (Operating Performance Points)
      currently exist inside the OPP library. These custom functions currently
      depend on internal data structures to pick up OPP information to create
      the cpufreq table.  For example, the cpufreq table is created precisely
      in the same order of how OPP entries are stored inside the list implementation.
      
      This kind of tight interdependency is purely artificial since the same
      functionality can be achieved using the generic OPP functions
      meant to do the same. This interdependency also limits the independent
      modification of cpufreq and OPP library.
      
      So use the generic dev_pm_opp_find_freq_ceil function that achieves the
      table organization as we currently use.
      
      As a result of this, we dont need to use the internal device_opp
      structure anymore, and we hence we can switch over to rcu lock instead
      of the mutex holding the internal list lock.
      
      This breaking of dependency on internal data structure imposes no change
      to usage of these.
      
      NOTE: This change is a precursor to moving this cpufreq specific logic
      out of the generic library into cpufreq.
      
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0f5c890e
  19. 18 4月, 2014 1 次提交
  20. 07 4月, 2014 1 次提交
  21. 26 3月, 2014 1 次提交
  22. 12 3月, 2014 1 次提交
  23. 06 3月, 2014 1 次提交
    • V
      cpufreq: suspend governors on system suspend/hibernate · 2f0aea93
      Viresh Kumar 提交于
      This patch adds cpufreq suspend/resume calls to dpm_{suspend|resume}()
      for handling suspend/resume of cpufreq governors.
      
      Lan Tianyu (Intel) & Jinhyuk Choi (Broadcom) found an issue where the
      tunables configuration for clusters/sockets with non-boot CPUs was
      lost after system suspend/resume, as we were notifying governors with
      CPUFREQ_GOV_POLICY_EXIT on removal of the last CPU for that policy
      which caused the tunables memory to be freed.
      
      This is fixed by preventing any governor operations from being
      carried out between the device suspend and device resume stages of
      system suspend and resume, respectively.
      
      We could have added these callbacks at dpm_{suspend|resume}_noirq()
      level, but there is an additional problem that the majority of I/O
      devices is already suspended at that point and if cpufreq drivers
      want to change the frequency before suspending, then that not be
      possible on some platforms (which depend on peripherals like i2c,
      regulators, etc).
      Reported-and-tested-by: NLan Tianyu <tianyu.lan@intel.com>
      Reported-by: NJinhyuk Choi <jinchoi@broadcom.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      [rjw: Changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2f0aea93
  24. 02 3月, 2014 2 次提交
    • U
      PM: Add pm_runtime_suspend|resume_force functions · 37f20416
      Ulf Hansson 提交于
      This patch provides two new runtime PM helper functions which intend to
      be used from system suspend/resume callbacks, to make sure devices are
      put into low power state during system suspend and brought back to full
      power at system resume.
      
      The prerequisite is to have all levels of a device's runtime PM
      callbacks to be defined through the SET_PM_RUNTIME_PM_OPS macro, which
      means these are available for CONFIG_PM.
      
      By using the new runtime PM helper functions especially the two
      scenarios below will be addressed.
      
      1) The PM core prevents .runtime_suspend callbacks from being invoked
      during system suspend. That means even for a runtime PM centric
      subsystem and driver, the device needs to be put into low power state
      from a system suspend callback. Otherwise it may very well be left in
      full power state (runtime resumed) while the system is suspended. By
      using the new helper functions, we make sure to walk the hierarchy of
      a device's power domain, subsystem and driver.
      
      2) Subsystems and drivers need to cope with all the combinations of
      CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME. The two new helper functions
      smothly addresses this.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      37f20416
    • U
      PM / runtime: Fetch runtime PM callbacks using a macro · 5f59df79
      Ulf Hansson 提交于
      While fetching the proper runtime PM callback, we walk the hierarchy of
      device's power domains, subsystems and drivers.
      
      This is common for rpm_suspend(), rpm_idle() and rpm_resume(). Let's
      clean up the code by using a macro that handles this.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5f59df79
  25. 01 3月, 2014 1 次提交
  26. 20 2月, 2014 1 次提交