1. 30 3月, 2017 1 次提交
  2. 29 3月, 2017 5 次提交
  3. 24 2月, 2017 3 次提交
  4. 09 2月, 2017 1 次提交
  5. 08 2月, 2017 1 次提交
  6. 27 1月, 2017 1 次提交
    • U
      PM / Domains: Rename functions in genpd for power on/off · 86e12eac
      Ulf Hansson 提交于
      Currently the mix of genpd_poweron(), genpd_power_on(),
      genpd_sync_poweron() and the ->power_on() callback, makes
      a bit difficult to follow the path of execution. The similar
      applies to the functions dealing with power off.
      
      In a way to improve this understanding, let's do the following renaming:
      
      genpd_power_on() ->  _genpd_power_on()
      genpd_poweron() -> genpd_power_on()
      genpd_sync_poweron() -> genpd_sync_power_on()
      
      genpd_power_off() -> _genpd_power_off()
      genpd_poweroff() -> genpd_power_off()
      genpd_sync_poweroff() -> genpd_sync_power_off()
      genpd_poweroff_unused() -> genpd_power_off_unused()
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      86e12eac
  7. 01 1月, 2017 1 次提交
  8. 26 12月, 2016 1 次提交
    • L
      avoid spurious "may be used uninitialized" warning · d33d5a6c
      Linus Torvalds 提交于
      The timer type simplifications caused a new gcc warning:
      
        drivers/base/power/domain.c: In function ‘genpd_runtime_suspend’:
        drivers/base/power/domain.c:562:14: warning: ‘time_start’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
      
      despite the actual use of "time_start" not having changed in any way.
      It appears that simply changing the type of ktime_t from a union to a
      plain scalar type made gcc check the use.
      
      The variable wasn't actually used uninitialized, but gcc apparently
      failed to notice that the conditional around the use was exactly the
      same as the conditional around the initialization of that variable.
      
      Add an unnecessary initialization just to shut up the compiler.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d33d5a6c
  9. 07 12月, 2016 1 次提交
  10. 01 12月, 2016 1 次提交
  11. 11 11月, 2016 1 次提交
  12. 27 10月, 2016 1 次提交
  13. 22 10月, 2016 5 次提交
  14. 24 9月, 2016 4 次提交
  15. 17 9月, 2016 1 次提交
  16. 13 9月, 2016 8 次提交
    • J
      PM / Domains: Add support for removing nested PM domains by provider · 17926551
      Jon Hunter 提交于
      If a device supports PM domains that are subdomains of another PM
      domain, then the PM domains should be removed in reverse order to
      ensure that the subdomains are removed first. Furthermore, if there is
      more than one provider, then there needs to be a way to remove the
      domains in reverse order for a specific provider.
      
      Add the function of_genpd_remove_last() to remove the last PM domain
      added by a given PM domain provider and return the generic_pm_domain
      structure for the PM domain that was removed.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      17926551
    • J
      PM / Domains: Add support for removing PM domains · 3fe57710
      Jon Hunter 提交于
      The genpd framework allows users to add PM domains via the pm_genpd_init()
      function, however, there is no corresponding function to remove a PM
      domain. For most devices this may be fine as the PM domains are never
      removed, however, for devices that wish to populate the PM domains from
      within a driver, having the ability to remove a PM domain if the probing
      of the device fails or the driver is unloaded is necessary.
      
      Add the function pm_genpd_remove() to remove a PM domain by referencing
      it's generic_pm_domain structure. Note that the bulk of the code that
      removes the PM domain is placed in a separate local function
      genpd_remove() (which is called by pm_genpd_remove()). The code is
      structured in this way to prepare for adding another function to remove
      a PM domain by provider that will also call genpd_remove(). Note that
      users of genpd_remove() must call this function with the mutex,
      gpd_list_lock, held.
      
      PM domains can only be removed if the associated provider has been
      removed, they are not a parent domain to another PM domain and have no
      devices associated with them.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3fe57710
    • J
      PM / Domains: Store the provider in the PM domain structure · de0aa06d
      Jon Hunter 提交于
      It is possible that a device has more than one provider of PM domains
      and to support the removal of a PM domain by provider, it is necessary
      to store a reference to the provider in the PM domain structure.
      Therefore, store a reference to the firmware node handle in the PM
      domain structure and populate it when providers (only device-tree based
      providers are currently supported by PM domains) are registered.
      
      Please note that when removing PM domains, it is necessary to verify
      that the PM domain provider has been removed from the list of providers
      before the PM domain can be removed. To do this add another member to
      the PM domain structure that indicates if the provider is present and
      set this member accordingly when providers are added and removed.
      
      Initialise the 'provider' and 'has_provider' members of the
      generic_pm_domain structure when a PM domains is added by calling
      pm_genpd_init().
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      de0aa06d
    • J
      PM / Domains: Prepare for adding support to remove PM domains · 19efa5ff
      Jon Hunter 提交于
      In order to remove PM domains safely from the list of PM domains,
      it is necessary to adding locking for the PM domain list around any
      places where devices or subdomains are added to a PM domain.
      
      There are places where a reference to a PM domain is obtained via
      calling of_genpd_get_from_provider() before adding the device or the
      subdomain. In these cases a lock for the PM domain list needs to be
      held around the call to of_genpd_get_from_provider() and the call to
      add the device/subdomain. To avoid deadlocks by multiple attempts to
      obtain the PM domain list lock, add functions genpd_add_device() and
      genpd_add_subdomain() which require the user to hold the PM domain
      list lock when calling.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      19efa5ff
    • J
      PM / Domains: Verify the PM domain is present when adding a provider · 0159ec67
      Jon Hunter 提交于
      When a PM domain provider is added, there is currently no way to tell if
      any PM domains associated with the provider are present. Naturally, the
      PM domain provider should not be registered if the PM domains have not
      been added. Nonetheless, verify that the PM domain(s) associated with a
      provider are present when registering the PM domain provider.
      
      This change adds a dependency on the function pm_genpd_present() when
      CONFIG_PM_GENERIC_DOMAINS_OF is enabled and so ensure this function is
      available when CONFIG_PM_GENERIC_DOMAINS_OF selected.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0159ec67
    • J
      PM / Domains: Don't expose xlate and provider helper functions · 892ebdcc
      Jon Hunter 提交于
      Functions __of_genpd_xlate_simple(), __of_genpd_xlate_onecell() and
      __of_genpd_add_provider() are not used outside of the core generic PM
      domain code. Therefore, reduce the number of APIs exposed by making
      these static. At the same time don't expose the typedef for
      genpd_xlate_t either and make this a local definition as well.
      
      The functions are renamed to follow the naming conventions for static
      functions in the generic PM domain core.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      892ebdcc
    • J
      PM / Domains: Don't expose generic_pm_domain structure to clients · f58d4e5a
      Jon Hunter 提交于
      There should be no need to expose the generic_pm_domain structure to
      clients and this eliminates the need to implement reference counting for
      any external reference to a PM domain. Therefore, make the functions
      pm_genpd_lookup_dev() and of_genpd_get_from_provider() private to the
      PM domain core. The functions are renamed in accordance with the naming
      conventions for genpd static functions.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f58d4e5a
    • J
      PM / Domains: Add new helper functions for device-tree · ec69572b
      Jon Hunter 提交于
      Ideally, if we are returning a reference to a PM domain via a call to
      of_genpd_get_from_provider(), then we should keep track of such
      references via a reference count. The reference count could then be used
      to determine if a PM domain can be safely removed. Alternatively, it is
      possible to avoid such external references by providing APIs to access
      the PM domain and hence, eliminate any calls to
      of_genpd_get_from_provider().
      
      Add new helper functions for adding a device and a subdomain to a PM
      domain when using device-tree, so that external calls to
      of_genpd_get_from_provider() can be removed.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ec69572b
  17. 12 8月, 2016 1 次提交
  18. 29 6月, 2016 1 次提交
  19. 16 6月, 2016 2 次提交
    • U
      PM / Domains: Stop/start devices during system PM suspend/resume in genpd · 122a2237
      Ulf Hansson 提交于
      Not all subsystems/drivers that manages devices attached to a genpd
      makes use of the pm_runtime_force_suspend|resume() helper functions
      to deal with system PM suspend/resume.
      
      In cases like these and when genpd's ->stop|start() callbacks are
      used for the device, invoke the pm_runtime_force_suspend|resume()
      helper functions from genpd's "noirq" system PM callbacks. In this
      way we make sure to "stop" the device on suspend and to "start" it
      on resume.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      122a2237
    • U
      PM / Domains: Allow runtime PM during system PM phases · 4d23a5e8
      Ulf Hansson 提交于
      In cases when a PM domain isn't powered off when genpd's ->prepare()
      callback is invoked, genpd runtime resumes and disables runtime PM for the
      device. This behaviour was needed when genpd managed intermediate states
      during the power off sequence, as to maintain proper low power states of
      devices during system PM suspend/resume.
      
      Commit ba2bbfbf (PM / Domains: Remove intermediate states from the
      power off sequence), enables genpd to improve its behaviour in that
      respect.
      
      The PM core disables runtime PM at __device_suspend_late() before it calls
      a system PM "late" callback for a device. When resuming a device, after a
      corresponding "early" callback has been invoked, the PM core re-enables
      runtime PM.
      
      By changing genpd to allow runtime PM according to the same system PM
      phases as the PM core, devices can be runtime resumed by their
      corresponding subsystem/driver when really needed.
      
      In this way, genpd no longer need to runtime resume the device from its
      ->prepare() callback. In most cases that avoids unnecessary and energy-
      wasting operations of runtime resuming devices that have nothing to do,
      only to runtime suspend them shortly after.
      
      Although, because of changing this behaviour in genpd and due to that
      genpd powers on the PM domain unconditionally in the system PM resume
      "noirq" phase, it could potentially cause a PM domain to stay powered
      on even if it's unused after the system has resumed. To avoid this,
      schedule a power off work when genpd's system PM ->complete() callback
      has been invoked for the last device in the PM domain.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4d23a5e8