1. 16 6月, 2016 1 次提交
    • U
      PM / Domains: Allow genpd to power on during system PM phases · 39dd0f23
      Ulf Hansson 提交于
      If a PM domain is powered off when the first device starts its system PM
      prepare phase, genpd prevents any further attempts to power on the PM
      domain during the following system PM phases. Not until the system PM
      complete phase is finalized for all devices in the PM domain, genpd again
      allows it to be powered on.
      
      This behaviour needs to be changed, as a subsystem/driver for a device in
      the same PM domain may still need to be able to serve requests in some of
      the system PM phases. Accordingly, it may need to runtime resume its
      device and thus also request the corresponding PM domain to be powered on.
      
      To deal with these scenarios, let's make the device operational in the
      system PM prepare phase by runtime resuming it, no matter if the PM domain
      is powered on or off. Changing this also enables us to remove genpd's
      suspend_power_off flag, as it's being used to track this condition.
      Additionally, we must allow the PM domain to be powered on via runtime PM
      during the system PM phases.
      
      This change also requires a fix in the AMD ACP (Audio CoProcessor) drm
      driver. It registers a genpd to model the ACP as a PM domain, but
      unfortunately it's also abuses genpd's "internal" suspend_power_off flag
      to deal with a corner case at system PM resume.
      
      More precisely, the so called SMU block powers on the ACP at system PM
      resume, unconditionally if it's being used or not. This may lead to that
      genpd's internal status of the power state, may not correctly reflect the
      power state of the HW after a system PM resume.
      
      Because of changing the behaviour of genpd, by runtime resuming devices in
      the prepare phase, the AMD ACP drm driver no longer have to deal with this
      corner case. So let's just drop the related code in this driver.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Hilman <khilman@baylibre.com>
      Acked-by: NMaruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      39dd0f23
  2. 27 4月, 2016 2 次提交
  3. 22 4月, 2016 3 次提交
  4. 09 3月, 2016 5 次提交
  5. 16 2月, 2016 2 次提交
    • A
      PM / Domains: remove old power on/off latencies · 90e63452
      Axel Haslam 提交于
      Now that all known users have been converted to use state latencies,
      we can remove the latency field in the generic_pm_domain structure.
      Signed-off-by: NAxel Haslam <ahaslam+renesas@baylibre.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      90e63452
    • A
      PM / Domains: Support for multiple states · fc5cbf0c
      Axel Haslam 提交于
      Some hardware (eg. OMAP), has the ability to enter different low power
      modes for a given power domain. This allows for more fine grained control
      over the power state of the platform. As a typical example, some registers
      of the hardware may be implemented with retention flip-flops and be able
      to retain their state at lower voltages allowing for faster on/off
      latencies and an increased window of opportunity to enter an intermediate
      low power state other than "off"
      
      When trying to set a power domain to off, the genpd governor will choose
      the deepest state that will respect the qos constraints of all the devices
      and sub-domains on the power domain. The state chosen by the governor is
      saved in the "state_idx" field of the generic_pm_domain structure and
      shall be used by the power_off and power_on callbacks to perform the
      necessary actions to set the power domain into (and out of) the state
      indicated by state_idx.
      
      States must be declared in ascending order from shallowest to deepest,
      deepest meaning the state which takes longer to enter and exit.
      
      For platforms that don't declare any states, a single a single "off"
      state is used. Once all platforms are converted to use the state array,
      the legacy on/off latencies will be removed.
      
      [ Lina: Modified genpd state initialization and remove use of
              save_state_latency_ns in genpd timing data ]
      Suggested-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NLina Iyer <lina.iyer@linaro.org>
      Signed-off-by: NAxel Haslam <ahaslam+renesas@baylibre.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fc5cbf0c
  6. 03 2月, 2016 1 次提交
  7. 28 1月, 2016 2 次提交
  8. 22 1月, 2016 1 次提交
    • M
      PM / domains: fix lockdep issue for all subdomains · 0106ef51
      Marek Szyprowski 提交于
      During genpd_poweron, genpd->lock is acquired recursively for each
      parent (master) domain, which are separate objects. This confuses
      lockdep, which considers every operation on genpd->lock as being done on
      the same lock class. This leads to the following false positive warning:
      
      =============================================
      [ INFO: possible recursive locking detected ]
      4.4.0-rc4-xu3s #32 Not tainted
      ---------------------------------------------
      swapper/0/1 is trying to acquire lock:
       (&genpd->lock){+.+...}, at: [<c0361550>] __genpd_poweron+0x64/0x108
      
      but task is already holding lock:
       (&genpd->lock){+.+...}, at: [<c0361af8>] genpd_dev_pm_attach+0x168/0x1b8
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(&genpd->lock);
        lock(&genpd->lock);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      3 locks held by swapper/0/1:
       #0:  (&dev->mutex){......}, at: [<c0350910>] __driver_attach+0x48/0x98
       #1:  (&dev->mutex){......}, at: [<c0350920>] __driver_attach+0x58/0x98
       #2:  (&genpd->lock){+.+...}, at: [<c0361af8>] genpd_dev_pm_attach+0x168/0x1b8
      
      stack backtrace:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.0-rc4-xu3s #32
      Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      [<c0016c98>] (unwind_backtrace) from [<c00139c4>] (show_stack+0x10/0x14)
      [<c00139c4>] (show_stack) from [<c0270df0>] (dump_stack+0x84/0xc4)
      [<c0270df0>] (dump_stack) from [<c00780b8>] (__lock_acquire+0x1f88/0x215c)
      [<c00780b8>] (__lock_acquire) from [<c007886c>] (lock_acquire+0xa4/0xd0)
      [<c007886c>] (lock_acquire) from [<c0641f2c>] (mutex_lock_nested+0x70/0x4d4)
      [<c0641f2c>] (mutex_lock_nested) from [<c0361550>] (__genpd_poweron+0x64/0x108)
      [<c0361550>] (__genpd_poweron) from [<c0361b00>] (genpd_dev_pm_attach+0x170/0x1b8)
      [<c0361b00>] (genpd_dev_pm_attach) from [<c03520a8>] (platform_drv_probe+0x2c/0xac)
      [<c03520a8>] (platform_drv_probe) from [<c03507d4>] (driver_probe_device+0x208/0x2fc)
      [<c03507d4>] (driver_probe_device) from [<c035095c>] (__driver_attach+0x94/0x98)
      [<c035095c>] (__driver_attach) from [<c034ec14>] (bus_for_each_dev+0x68/0x9c)
      [<c034ec14>] (bus_for_each_dev) from [<c034fec8>] (bus_add_driver+0x1a0/0x218)
      [<c034fec8>] (bus_add_driver) from [<c035115c>] (driver_register+0x78/0xf8)
      [<c035115c>] (driver_register) from [<c0338488>] (exynos_drm_register_drivers+0x28/0x74)
      [<c0338488>] (exynos_drm_register_drivers) from [<c0338594>] (exynos_drm_init+0x6c/0xc4)
      [<c0338594>] (exynos_drm_init) from [<c00097f4>] (do_one_initcall+0x90/0x1dc)
      [<c00097f4>] (do_one_initcall) from [<c0895e08>] (kernel_init_freeable+0x158/0x1f8)
      [<c0895e08>] (kernel_init_freeable) from [<c063ecac>] (kernel_init+0x8/0xe8)
      [<c063ecac>] (kernel_init) from [<c000f7d0>] (ret_from_fork+0x14/0x24)
      
      This patch replaces mutex_lock with mutex_lock_nested() and uses
      recursion depth to annotate each genpd->lock operation with separate
      lockdep subclass.
      Reported-by: NAnand Moon <linux.amoon@gmail.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Tested-by: NAnand Moon <linux.amoon@gmail.com>
      Tested-by: NTobias Jakobi <tjakobi@math.uni-bielefeld.de>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0106ef51
  9. 08 1月, 2016 2 次提交
  10. 10 12月, 2015 2 次提交
  11. 04 12月, 2015 1 次提交
  12. 02 11月, 2015 2 次提交
  13. 28 10月, 2015 2 次提交
  14. 14 10月, 2015 1 次提交
  15. 13 10月, 2015 3 次提交
  16. 09 10月, 2015 1 次提交
  17. 27 9月, 2015 1 次提交
  18. 26 9月, 2015 2 次提交
  19. 05 9月, 2015 1 次提交
  20. 03 9月, 2015 1 次提交
  21. 29 8月, 2015 3 次提交
  22. 01 8月, 2015 1 次提交
    • J
      PM / Domains: Return -EPROBE_DEFER if we fail to init or turn-on domain · 311fa6ad
      Jon Hunter 提交于
      When a device is probed, the function dev_pm_domain_attach() is called
      to see if there is a power-domain that is associated with the device and
      needs to be turned on. If dev_pm_domain_attach() does not return
      -EPROBE_DEFER then the device will be probed.
      
      For devices using genpd, dev_pm_domain_attach() will call
      genpd_dev_pm_attach(). If genpd_dev_pm_attach() does not find a power
      domain associated with the device then it returns an error code not
      equal to -EPROBE_DEFER to allow the device to be probed. However, if
      genpd_dev_pm_attach() does find a power-domain that is associated with
      the device, then it does not return -EPROBE_DEFER on failure and hence
      the device will still be probed. Furthermore, genpd_dev_pm_attach() does
      not check the error code returned by pm_genpd_poweron() to see if the
      power-domain was turned on successfully.
      
      Fix this by checking the return code from pm_genpd_poweron() and
      returning -EPROBE_DEFER from genpd_dev_pm_attach on failure, if there
      is a power-domain associated with the device.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Acked-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      311fa6ad