1. 15 7月, 2013 1 次提交
  2. 02 5月, 2012 2 次提交
    • R
      PM / Sleep: Add "prevent autosleep time" statistics to wakeup sources · 55850945
      Rafael J. Wysocki 提交于
      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
      way.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55850945
    • R
      PM / Sleep: Change wakeup source statistics to follow Android · 30e3ce6d
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30e3ce6d
  3. 05 3月, 2012 1 次提交
  4. 15 3月, 2011 1 次提交
    • R
      PM: Do not create wakeup sysfs files for devices that cannot wake up · cb8f51bd
      Rafael J. Wysocki 提交于
      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
      empty).
      
      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: NRafael J. Wysocki <rjw@sisk.pl>
      cb8f51bd
  5. 25 2月, 2011 1 次提交
  6. 17 10月, 2010 1 次提交
    • R
      PM / Wakeup: Introduce wakeup source objects and event statistics (v3) · 074037ec
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      074037ec
  7. 19 7月, 2010 1 次提交
    • A
      PM: describe kernel policy regarding wakeup defaults (v. 2) · 2430d12c
      Alan Stern 提交于
      This patch (as1381b) updates a comment describing the kernel's policy
      toward enabling wakeup by default.
      
      It also makes device_set_wakeup_capable() actually do something when
      CONFIG_PM isn't enabled.  It's not clear this is necessary; however if
      it isn't then device_init_wakeup() and device_can_wakeup() should also
      be do-nothing routines.  Furthermore, I don't expect this change to
      have any noticeable effect -- but if it does then clearly the old
      behavior was wrong.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      2430d12c
  8. 11 5月, 2010 1 次提交
  9. 15 7月, 2008 1 次提交
  10. 08 7月, 2008 1 次提交
    • R
      PCI ACPI: Rework PCI handling of wake-up · eb9d0fe4
      Rafael J. Wysocki 提交于
      * 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: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      eb9d0fe4
  11. 20 4月, 2008 1 次提交