Skip to content
Snippets Groups Projects
  1. Jul 15, 2022
  2. Jul 08, 2022
  3. Apr 13, 2022
  4. Mar 03, 2022
  5. Dec 27, 2021
  6. Dec 17, 2021
    • Rafael J. Wysocki's avatar
      PM: runtime: Capture device status before disabling runtime PM · c24efa67
      Rafael J. Wysocki authored
      In some cases (for example, during system-wide suspend and resume of
      devices) it is useful to know whether or not runtime PM has ever been
      enabled for a given device and, if so, what the runtime PM status of
      it had been right before runtime PM was disabled for it last time.
      
      For this reason, introduce a new struct dev_pm_info field called
      last_status that will be used for capturing the runtime PM status of
      the device when its power.disable_depth counter changes from 0 to 1.
      
      The new field will be set to RPM_INVALID to start with and whenever
      power.disable_depth changes from 1 to 0, so it will be valid only
      when runtime PM of the device is currently disabled, but it has been
      enabled at least once.
      
      Immediately use power.last_status in rpm_resume() to make it handle
      the case when PM runtime is disabled for the device, but its runtime
      PM status is RPM_ACTIVE more consistently.  Namely, make it return 1
      if power.last_status is also equal to RPM_ACTIVE in that case (the
      idea being that if the status was RPM_ACTIVE last time when
      power.disable_depth was changing from 0 to 1 and it is still
      RPM_ACTIVE, it can be assumed to reflect what happened to the device
      last time when it was using runtime PM) and -EACCES otherwise.
      
      Update the documentation to provide a description of last_status and
      change the description of pm_runtime_resume() in it to reflect the
      new behavior of rpm_active().
      
      While at it, rearrange the code in pm_runtime_enable() to be more
      straightforward and replace the WARN() macro in it with a pr_warn()
      invocation which is less disruptive.
      
      Link: https://lore.kernel.org/linux-pm/20211026222626.39222-1-ulf.hansson@linaro.org/t/#u
      
      
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c24efa67
  7. Nov 10, 2021
    • Lukasz Luba's avatar
      Documentation: power: Describe 'advanced' and 'simple' EM models · 08374410
      Lukasz Luba authored
      
      The Energy Model (EM) can be registered in two ways:
      
       1) Using a helper function, which under the hood relies on OPP framework
          and DT entry in CPU node: 'dynamic-power-coefficient'. This is
          a 'simple' EM because it's tied to the math formula:
          Power = dynamic-power-coefficient * V^2 * f
      
       2) Using em_dev_register_perf_domain() API function with a driver
          custom callback which provides power for each performance state.
      
          This is 'advanced' EM, since it can better reflect real power
          measurements for each performance state. It's not limited to any
          math formula and can better reflect real physics of the device.
      
      Add description of these two methods to the documentation, so developers
      could choose the suitable registration method (option).
      
      Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
      [ rjw: Changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      08374410
    • Lukasz Luba's avatar
      Documentation: power: Add description about new callback for EM registration · d704aa0d
      Lukasz Luba authored
      
      The Energy Model (EM) registration for CPUs should now be done using
      a dedicated callback added recently into CPUFreq framework and drivers.
      
      Commit c17495b0 ("cpufreq: Add callback to register with energy model")
      
      The callback guaranties that the EM registration is called at the right
      time during driver setup. To avoid mistakes update the documentation
      to align with the existing code implementation.
      
      Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d704aa0d
  8. Sep 07, 2021
  9. Jun 11, 2021
  10. May 31, 2021
  11. Apr 09, 2021
  12. Apr 02, 2021
  13. Jan 27, 2021
  14. Jan 11, 2021
  15. Dec 22, 2020
  16. Nov 10, 2020
  17. Sep 29, 2020
  18. Jul 27, 2020
  19. Jun 24, 2020
  20. May 07, 2020
  21. Apr 24, 2020
  22. Mar 14, 2020
  23. Mar 04, 2020
    • Sakari Ailus's avatar
      PM: runtime: Add pm_runtime_get_if_active() · c111566b
      Sakari Ailus authored
      
      pm_runtime_get_if_in_use() bumps up the PM-runtime usage count if it
      is not equal to zero and the device's PM-runtime status is 'active'.
      This works for drivers that do not use autoidle, but for those that
      do, the function returns zero even when the device is active.
      
      In order to maintain sane device state while the device is powered on
      in the hope that it'll be needed, pm_runtime_get_if_active(dev, true)
      returns a positive value if the device's PM-runtime status is 'active'
      when it is called, in which case it also increments the device's usage
      count.
      
      If the second argument of pm_runtime_get_if_active() is 'false', the
      function behaves just like pm_runtime_get_if_in_use(), so redefine
      the latter as a wrapper around the former.
      
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      [ rjw: Changelog ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c111566b
  24. Feb 20, 2020
  25. Feb 14, 2020
  26. Feb 03, 2020
  27. Nov 20, 2019
Loading