1. 27 Jul, 2013 1 commit
  2. 04 Mar, 2013 1 commit
    • Rafael J. Wysocki's avatar
      PM / QoS: Remove device PM QoS sysfs attributes at the right place · 37530f2b
      Rafael J. Wysocki authored
      Device PM QoS sysfs attributes, if present during device removal,
      are removed from within device_pm_remove(), which is too late,
      since dpm_sysfs_remove() has already removed the whole attribute
      group they belonged to.  However, moving the removal of those
      attributes to dpm_sysfs_remove() alone is not sufficient, because
      in theory they still can be re-added right after being removed by it
      (the device's driver is still bound to it at that point).
      For this reason, move the entire desctruction of device PM QoS
      constraints to dpm_sysfs_remove() and make it prevent any new
      constraints from being added after it has run.  Also, move the
      initialization of the power.qos field in struct device to
      device_pm_init_common() and drop the no longer needed
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  3. 24 Oct, 2012 1 commit
    • Rafael J. Wysocki's avatar
      PM / QoS: Make it possible to expose PM QoS device flags to user space · e39473d0
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarJean Pihet <j-pihet@ti.com>
      Acked-by: default avatarmark gross <markgross@thegnar.org>
  4. 22 Oct, 2012 1 commit
  5. 12 Jul, 2012 1 commit
  6. 01 May, 2012 2 commits
    • Rafael J. Wysocki's avatar
      PM / Sleep: Add "prevent autosleep time" statistics to wakeup sources · 55850945
      Rafael J. Wysocki authored
      Android uses one wakelock statistics that is only necessary for
      opportunistic sleep.  Namely, the prevent_suspend_time field
      accumulates the total time the given wakelock has been locked
      while "automatic suspend" was enabled.  Add an analogous field,
      prevent_sleep_time, to wakeup sources and make it behave in a similar
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    • Rafael J. Wysocki's avatar
      PM / Sleep: Change wakeup source statistics to follow Android · 30e3ce6d
      Rafael J. Wysocki authored
      Wakeup statistics used by Android are slightly different from what we
      have in wakeup sources at the moment and there aren't any known
      users of those statistics other than Android, so modify them to make
      it easier for Android to switch to wakeup sources.
      This removes the struct wakeup_source's hit_cout field, which is very
      rough and therefore not very useful, and adds two new fields,
      wakeup_count and expire_count.  The first one tracks how many times
      the wakeup source is activated with events_check_enabled set (which
      roughly corresponds to the situations when a system power transition
      to a sleep state is in progress and would be aborted by this wakeup
      source if it were the only active one at that time) and the second
      one is the number of times the wakeup source has been activated with
      a timeout that expired.
      Additionally, the last_time field is now updated when the wakeup
      source is deactivated too (previously it was only updated during
      the wakeup source's activation), which seems to be what Android does
      with the analogous counter for wakelocks.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  7. 13 Mar, 2012 1 commit
    • Rafael J. Wysocki's avatar
      PM / QoS: Make it possible to expose PM QoS latency constraints · 85dc0b8a
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
      Reviewed-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
  8. 31 Oct, 2011 1 commit
  9. 26 Jul, 2011 1 commit
  10. 06 Jul, 2011 1 commit
  11. 17 May, 2011 1 commit
  12. 14 Mar, 2011 1 commit
    • Rafael J. Wysocki's avatar
      PM: Do not create wakeup sysfs files for devices that cannot wake up · cb8f51bd
      Rafael J. Wysocki authored
      Currently, wakeup sysfs attributes are created for all devices,
      regardless of whether or not they are wakeup-capable.  This is
      excessive and complicates wakeup device identification from user
      space (i.e. to identify wakeup-capable devices user space has to read
      /sys/devices/.../power/wakeup for all devices and see if they are not
      Fix this issue by avoiding to create wakeup sysfs files for devices
      that cannot wake up the system from sleep states (i.e. whose
      power.can_wakeup flags are unset during registration) and modify
      device_set_wakeup_capable() so that it adds (or removes) the relevant
      sysfs attributes if a device's wakeup capability status is changed.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
  13. 16 Oct, 2010 3 commits
    • Alan Stern's avatar
      PM / Runtime: Implement autosuspend support · 15bcb91d
      Alan Stern authored
      This patch (as1427) implements the "autosuspend" facility for runtime
      PM.  A few new fields are added to the dev_pm_info structure and
      several new PM helper functions are defined, for telling the PM core
      whether or not a device uses autosuspend, for setting the autosuspend
      delay, and for marking periods of device activity.
      Drivers that do not want to use autosuspend can continue using the
      same helper functions as before; their behavior will not change.  In
      addition, drivers supporting autosuspend can also call the old helper
      functions to get the old behavior.
      The details are all explained in Documentation/power/runtime_pm.txt
      and Documentation/ABI/testing/sysfs-devices-power.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    • Alan Stern's avatar
      PM / Runtime: Add no_callbacks flag · 7490e442
      Alan Stern authored
      Some devices, such as USB interfaces, cannot be power-managed
      independently of their parents, i.e., they cannot be put in low power
      while the parent remains at full power.  This patch (as1425) creates a
      new "no_callbacks" flag, which tells the PM core not to invoke the
      runtime-PM callback routines for the such devices but instead to
      assume that the callbacks always succeed.  In addition, the
      non-debugging runtime-PM sysfs attributes for the devices are removed,
      since they are pretty much meaningless.
      The advantage of this scheme comes not so much from avoiding the
      callbacks themselves, but rather from the fact that without the need
      for a process context in which to run the callbacks, more work can be
      done in interrupt context.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    • Rafael J. Wysocki's avatar
      PM / Wakeup: Introduce wakeup source objects and event statistics (v3) · 074037ec
      Rafael J. Wysocki authored
      Introduce struct wakeup_source for representing system wakeup sources
      within the kernel and for collecting statistics related to them.
      Make the recently introduced helper functions pm_wakeup_event(),
      pm_stay_awake() and pm_relax() use struct wakeup_source objects
      internally, so that wakeup statistics associated with wakeup devices
      can be collected and reported in a consistent way (the definition of
      pm_relax() is changed, which is harmless, because this function is
      not called directly by anyone yet).  Introduce new wakeup-related
      sysfs device attributes in /sys/devices/.../power for reporting the
      device wakeup statistics.
      Change the global wakeup events counters event_count and
      events_in_progress into atomic variables, so that it is not necessary
      to acquire a global spinlock in pm_wakeup_event(), pm_stay_awake()
      and pm_relax(), which should allow us to avoid lock contention in
      these functions on SMP systems with many wakeup devices.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  14. 19 Jul, 2010 2 commits
    • Arjan van de Ven's avatar
      PM / Runtime: Add runtime PM statistics (v3) · 8d4b9d1b
      Arjan van de Ven authored
      In order for PowerTOP to be able to report how well the new runtime PM is
      working for the various drivers, the kernel needs to export some basic
      statistics in sysfs.
      This patch adds two sysfs files in the runtime PM domain that expose the
      total time a device has been active, and the time a device has been
      With this PowerTOP can compute the activity percentage
      Active %age = 100 * (delta active) / (delta active + delta suspended)
      and present the information to the user.
      I've written the PowerTOP code (slated for version 1.12) already, and the
      output looks like this:
      Runtime Device Power Management statistics
      Active  Device name
       10.0%	06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller
      [version 2: fix stat update bugs noticed by Alan Stern]
      [version 3: rebase to -next and move the sysfs declaration]
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    • Alan Stern's avatar
      PM / Runtime: Make runtime_status attribute not debug-only (v. 2) · 0fcb4eef
      Alan Stern authored
      This patch (as1404b) makes the runtime_status sysfs attribute available
      even in the absence of CONFIG_PM_ADVANCED_DEBUG, and it changes the
      routine to display "unsupported" when runtime PM is disabled for a
      device.  Although not strictly 100% accurate, this will almost always
      be correct.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
  15. 18 Jul, 2010 1 commit
    • Rafael J. Wysocki's avatar
      PM: Make it possible to avoid races between wakeup and system sleep · c125e96f
      Rafael J. Wysocki authored
      One of the arguments during the suspend blockers discussion was that
      the mainline kernel didn't contain any mechanisms making it possible
      to avoid races between wakeup and system suspend.
      Generally, there are two problems in that area.  First, if a wakeup
      event occurs exactly when /sys/power/state is being written to, it
      may be delivered to user space right before the freezer kicks in, so
      the user space consumer of the event may not be able to process it
      before the system is suspended.  Second, if a wakeup event occurs
      after user space has been frozen, it is not generally guaranteed that
      the ongoing transition of the system into a sleep state will be
      To address these issues introduce a new global sysfs attribute,
      /sys/power/wakeup_count, associated with a running counter of wakeup
      events and three helper functions, pm_stay_awake(), pm_relax(), and
      pm_wakeup_event(), that may be used by kernel subsystems to control
      the behavior of this attribute and to request the PM core to abort
      system transitions into a sleep state already in progress.
      The /sys/power/wakeup_count file may be read from or written to by
      user space.  Reads will always succeed (unless interrupted by a
      signal) and return the current value of the wakeup events counter.
      Writes, however, will only succeed if the written number is equal to
      the current value of the wakeup events counter.  If a write is
      successful, it will cause the kernel to save the current value of the
      wakeup events counter and to abort the subsequent system transition
      into a sleep state if any wakeup events are reported after the write
      has returned.
      [The assumption is that before writing to /sys/power/state user space
      will first read from /sys/power/wakeup_count.  Next, user space
      consumers of wakeup events will have a chance to acknowledge or
      veto the upcoming system transition to a sleep state.  Finally, if
      the transition is allowed to proceed, /sys/power/wakeup_count will
      be written to and if that succeeds, /sys/power/state will be written
      to as well.  Still, if any wakeup events are reported to the PM core
      by kernel subsystems after that point, the transition will be
      Additionally, put a wakeup events counter into struct dev_pm_info and
      make these per-device wakeup event counters available via sysfs,
      so that it's possible to check the activity of various wakeup event
      sources within the kernel.
      To illustrate how subsystems can use pm_wakeup_event(), make the
      low-level PCI runtime PM wakeup-handling code use it.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarmarkgross <markgross@thegnar.org>
      Reviewed-by: default avatarAlan Stern <stern@rowland.harvard.edu>
  16. 10 May, 2010 1 commit
    • Dominik Brodowski's avatar
      PM / Runtime: Add sysfs debug files · c92445fa
      Dominik Brodowski authored
      Add a few sysfs files relating to runtime power management for
      advanced debug purposes:
      runtime_enabled: is runtime PM enabled for this device? States
      	are "enabled", "disabled", "forbidden" or a combination
      	of the latter two.
      runtime_status:	what state is the device in currently? E.g., it
      	reports "suspended" for runtime-suspended devices, and
              "active" for active devices. NOTE: if runtime_enabled
      	returns "disabled", the value of this file may not
      	reflect its physical state.
      runtime_usage: the runtime PM usage count of a device
      runtime_active_kids: the runtime PM children usage count of a device, or
      	0 if the ignore_children flag is set.
      Also, CONFIG_PM_SLEEP_ADVANCED_DEBUG is not defined in any Kconfig
      file, so replace it with CONFIG_PM_ADVANCED_DEBUG.
      Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
  17. 26 Feb, 2010 2 commits
  18. 07 Jul, 2008 1 commit
    • Rafael J. Wysocki's avatar
      PCI ACPI: Rework PCI handling of wake-up · eb9d0fe4
      Rafael J. Wysocki authored
      * Introduce function acpi_pm_device_sleep_wake() for enabling and
        disabling the system wake-up capability of devices that are power
        manageable by ACPI.
      * Introduce function acpi_bus_can_wakeup() allowing other (dependent)
        subsystems to check if ACPI is able to enable the system wake-up
        capability of given device.
      * Introduce callback .sleep_wake() in struct pci_platform_pm_ops and
        for the ACPI PCI 'driver' make it use acpi_pm_device_sleep_wake().
      * Introduce callback .can_wakeup() in struct pci_platform_pm_ops and
        for the ACPI 'driver' make it use acpi_bus_can_wakeup().
      * Move the PME# handlig code out of pci_enable_wake() and split it
        into two functions, pci_pme_capable() and pci_pme_active(),
        allowing the caller to check if given device is capable of
        generating PME# from given power state and to enable/disable the
        device's PME# functionality, respectively.
      * Modify pci_enable_wake() to use the new ACPI callbacks and the new
        PME#-related functions.
      * Drop the generic .platform_enable_wakeup() callback that is not
        used any more.
      * Introduce device_set_wakeup_capable() that will set the
        power.can_wakeup flag of given device.
      * Rework PCI device PM initialization so that, if given device is
        capable of generating wake-up events, either natively through the
        PME# mechanism, or with the help of the platform, its
        power.can_wakeup flag is set and its power.should_wakeup flag is
        unset as appropriate.
      * Make ACPI set the power.can_wakeup flag for devices found to be
        wake-up capable by it.
      * Make the ACPI wake-up code enable/disable GPEs for devices that
        have the wakeup.flags.prepared flag set (which means that their
        wake-up power has been enabled).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
  19. 20 Apr, 2008 1 commit
  20. 18 Jul, 2007 1 commit
  21. 26 Sep, 2006 2 commits
  22. 06 Feb, 2006 1 commit
  23. 07 Nov, 2005 1 commit
  24. 28 Oct, 2005 1 commit
    • David Brownell's avatar
      [PATCH] driver model wakeup flags · 0ac85241
      David Brownell authored
      This is a refresh of an earlier patch to add "wakeup" support to the
      PM core model.  This provides per-device bus-neutral control of the
      use of wakeup events.
        * "struct device_pm_info" has two bits that are initialized as
          part of setting up the enclosing struct device:
            - "can_wakeup", reflecting hardware capabilities
            - "may_wakeup", the policy setting (when CONFIG_PM)
        * There's a writeable sysfs "wakeup" file, with one of two values:
            - "enabled", when the policy is to allow wakeup
            - "disabled", when the policy is not to allow it
            - "" if the device can't currently issue wakeups
      By default, wakeup is enabled on all devices that support it.  If its
      driver doesn't support it ... treat it as a bug.  :)
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  25. 05 Sep, 2005 1 commit
  26. 20 Jun, 2005 1 commit
  27. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      Let it rip!