1. 18 Nov, 2014 1 commit
    • Rafael J. Wysocki's avatar
      PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected · b2b49ccb
      Rafael J. Wysocki authored
      
      
      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: default avatarKevin Hilman <khilman@linaro.org>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b2b49ccb
  2. 14 Nov, 2014 1 commit
  3. 22 Sep, 2014 2 commits
  4. 22 Jul, 2014 1 commit
  5. 19 May, 2014 1 commit
  6. 18 Oct, 2013 1 commit
    • Benoit Goby's avatar
      PM / Sleep: Detect device suspend/resume lockup and log event · 70fea60d
      Benoit Goby authored
      
      
      Rather than hard-lock the kernel, dump the suspend/resume thread stack
      and panic() to capture a message in pstore when a driver takes too long
      to suspend/resume. Default suspend/resume watchdog timeout is set to 12
      seconds to be longer than the usbhid 10 second timeout, but could be
      changed at compile time.
      
      Exclude from the watchdog the time spent waiting for children that
      are resumed asynchronously and time every device, whether or not they
      resumed synchronously.
      
      This patch is targeted for mobile devices where a suspend/resume lockup
      could cause a system reboot. Information about failing device can be
      retrieved in subsequent boot session by mounting pstore and inspecting
      the log. Laptops with EFI-enabled pstore could also benefit from
      this feature.
      
      The hardware watchdog timer is likely suspended during this time and
      couldn't be relied upon. The soft-lockup detector would eventually tell
      that tasks are not scheduled, but would provide little context as to why.
      The patch hence uses system timer and assumes it is still active while the
      devices are suspended/resumed.
      
      This feature can be enabled/disabled during kernel configuration.
      
      This change is based on earlier work by San Mehat.
      
      Signed-off-by: default avatarBenoit Goby <benoit@android.com>
      Signed-off-by: default avatarZoran Markovic <zoran.markovic@linaro.org>
      Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      70fea60d
  7. 03 Jun, 2013 1 commit
  8. 14 May, 2013 1 commit
    • Viresh Kumar's avatar
      workqueues: Introduce new flag WQ_POWER_EFFICIENT for power oriented workqueues · cee22a15
      Viresh Kumar authored
      
      
      Workqueues can be performance or power-oriented. Currently, most workqueues are
      bound to the CPU they were created on. This gives good performance (due to cache
      effects) at the cost of potentially waking up otherwise idle cores (Idle from
      scheduler's perspective. Which may or may not be physically idle) just to
      process some work. To save power, we can allow the work to be rescheduled on a
      core that is already awake.
      
      Workqueues created with the WQ_UNBOUND flag will allow some power savings.
      However, we don't change the default behaviour of the system.  To enable
      power-saving behaviour, a new config option CONFIG_WQ_POWER_EFFICIENT needs to
      be turned on. This option can also be overridden by the
      workqueue.power_efficient boot parameter.
      
      tj: Updated config description and comments.  Renamed
          CONFIG_WQ_POWER_EFFICIENT to CONFIG_WQ_POWER_EFFICIENT_DEFAULT.
      
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: default avatarAmit Kucheria <amit.kucheria@linaro.org>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      cee22a15
  9. 03 Sep, 2012 1 commit
    • Rafael J. Wysocki's avatar
      PM / Domains: Add power off/on function for system core suspend stage · 77f827de
      Rafael J. Wysocki authored
      
      
      Introduce function pm_genpd_syscore_switch() and two wrappers around
      it, pm_genpd_syscore_poweroff() and pm_genpd_syscore_poweron(),
      allowing the callers to let the generic PM domains framework know
      that the given device is not necessary any more and its PM domain
      can be turned off (the former) or that the given device will be
      required immediately, so its PM domain has to be turned on (the
      latter) during the system core (syscore) stage of system suspend
      (or hibernation) and resume.
      
      These functions will be used for handling devices registered as
      clock sources and clock event devices that belong to PM domains.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      77f827de
  10. 01 Jul, 2012 1 commit
  11. 11 May, 2012 2 commits
  12. 01 May, 2012 2 commits
    • Rafael J. Wysocki's avatar
      PM / Sleep: Add user space interface for manipulating wakeup sources, v3 · b86ff982
      Rafael J. Wysocki authored
      
      
      Android allows user space to manipulate wakelocks using two
      sysfs file located in /sys/power/, wake_lock and wake_unlock.
      Writing a wakelock name and optionally a timeout to the wake_lock
      file causes the wakelock whose name was written to be acquired (it
      is created before is necessary), optionally with the given timeout.
      Writing the name of a wakelock to wake_unlock causes that wakelock
      to be released.
      
      Implement an analogous interface for user space using wakeup sources.
      Add the /sys/power/wake_lock and /sys/power/wake_unlock files
      allowing user space to create, activate and deactivate wakeup
      sources, such that writing a name and optionally a timeout to
      wake_lock causes the wakeup source of that name to be activated,
      optionally with the given timeout.  If that wakeup source doesn't
      exist, it will be created and then activated.  Writing a name to
      wake_unlock causes the wakeup source of that name, if there is one,
      to be deactivated.  Wakeup sources created with the help of
      wake_lock that haven't been used for more than 5 minutes are garbage
      collected and destroyed.  Moreover, there can be only WL_NUMBER_LIMIT
      wakeup sources created with the help of wake_lock present at a time.
      
      The data type used to track wakeup sources created by user space is
      called "struct wakelock" to indicate the origins of this feature.
      
      This version of the patch includes an rbtree manipulation fix from John Stultz.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarNeilBrown <neilb@suse.de>
      b86ff982
    • Rafael J. Wysocki's avatar
      PM / Sleep: Implement opportunistic sleep, v2 · 7483b4a4
      Rafael J. Wysocki authored
      
      
      Introduce a mechanism by which the kernel can trigger global
      transitions to a sleep state chosen by user space if there are no
      active wakeup sources.
      
      It consists of a new sysfs attribute, /sys/power/autosleep, that
      can be written one of the strings returned by reads from
      /sys/power/state, an ordered workqueue and a work item carrying out
      the "suspend" operations.  If a string representing the system's
      sleep state is written to /sys/power/autosleep, the work item
      triggering transitions to that state is queued up and it requeues
      itself after every execution until user space writes "off" to
      /sys/power/autosleep.
      
      That work item enables the detection of wakeup events using the
      functions already defined in drivers/base/power/wakeup.c (with one
      small modification) and calls either pm_suspend(), or hibernate() to
      put the system into a sleep state.  If a wakeup event is reported
      while the transition is in progress, it will abort the transition and
      the "system suspend" work item will be queued up again.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarNeilBrown <neilb@suse.de>
      7483b4a4
  13. 16 Oct, 2011 2 commits
  14. 23 Sep, 2011 1 commit
  15. 14 Aug, 2011 1 commit
  16. 11 Jul, 2011 1 commit
  17. 02 Jul, 2011 2 commits
    • Rafael J. Wysocki's avatar
      PM: Allow the clocks management code to be used during system suspend · b7b95920
      Rafael J. Wysocki authored
      
      
      The common clocks management code in drivers/base/power/clock_ops.c
      is going to be used during system-wide power transitions as well as
      for runtime PM, so it shouldn't depend on CONFIG_PM_RUNTIME.
      However, the suspend/resume functions provided by it for
      CONFIG_PM_RUNTIME unset, to be used during system-wide power
      transitions, should not behave in the same way as their counterparts
      defined for CONFIG_PM_RUNTIME set, because in that case the clocks
      are managed differently at run time.
      
      The names of the functions still contain the word "runtime" after
      this change, but that is going to be modified by a separate patch
      later.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
      b7b95920
    • Rafael J. Wysocki's avatar
      PM / Domains: Support for generic I/O PM domains (v8) · f721889f
      Rafael J. Wysocki authored
      
      
      Introduce common headers, helper functions and callbacks allowing
      platforms to use simple generic power domains for runtime power
      management.
      
      Introduce struct generic_pm_domain to be used for representing
      power domains that each contain a number of devices and may be
      parent domains or subdomains with respect to other power domains.
      Among other things, this structure includes callbacks to be
      provided by platforms for performing specific tasks related to
      power management (i.e. ->stop_device() may disable a device's
      clocks, while ->start_device() may enable them, ->power_off() is
      supposed to remove power from the entire power domain
      and ->power_on() is supposed to restore it).
      
      Introduce functions that can be used as power domain runtime PM
      callbacks, pm_genpd_runtime_suspend() and pm_genpd_runtime_resume(),
      as well as helper functions for the initialization of a power
      domain represented by a struct generic_power_domain object,
      adding a device to or removing a device from it and adding or
      removing subdomains.
      
      Introduce configuration option CONFIG_PM_GENERIC_DOMAINS to be
      selected by the platforms that want to use the new code.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
      f721889f
  18. 17 May, 2011 1 commit
  19. 29 Apr, 2011 1 commit
  20. 11 Apr, 2011 2 commits
  21. 14 Mar, 2011 5 commits
  22. 07 Jan, 2011 1 commit
  23. 11 Nov, 2010 1 commit
  24. 16 Oct, 2010 3 commits
  25. 10 Jun, 2010 1 commit
  26. 26 Feb, 2010 1 commit
    • Rafael J. Wysocki's avatar
      PM: Add facility for advanced testing of async suspend/resume · 5a2eb858
      Rafael J. Wysocki authored
      
      
      Add configuration switch CONFIG_PM_ADVANCED_DEBUG for compiling in
      extra PM debugging/testing code allowing one to access some
      PM-related attributes of devices from the user space via sysfs.
      
      If CONFIG_PM_ADVANCED_DEBUG is set, add sysfs attribute power/async
      for every device allowing the user space to access the device's
      power.async_suspend flag and modify it, if desired.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      5a2eb858
  27. 23 Feb, 2010 1 commit
  28. 22 Aug, 2009 1 commit
    • Rafael J. Wysocki's avatar
      PM: Introduce core framework for run-time PM of I/O devices (rev. 17) · 5e928f77
      Rafael J. Wysocki authored
      
      
      Introduce a core framework for run-time power management of I/O
      devices.  Add device run-time PM fields to 'struct dev_pm_info'
      and device run-time PM callbacks to 'struct dev_pm_ops'.  Introduce
      a run-time PM workqueue and define some device run-time PM helper
      functions at the core level.  Document all these things.
      
      Special thanks to Alan Stern for his help with the design and
      multiple detailed reviews of the pereceding versions of this patch
      and to Magnus Damm for testing feedback.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@igel.co.jp>
      5e928f77