1. 12 1月, 2016 1 次提交
  2. 08 1月, 2016 4 次提交
  3. 02 1月, 2016 1 次提交
  4. 21 12月, 2015 1 次提交
  5. 09 12月, 2015 1 次提交
  6. 04 12月, 2015 1 次提交
  7. 02 12月, 2015 1 次提交
  8. 30 11月, 2015 2 次提交
    • U
      PM / runtime: Re-init runtime PM states at probe error and driver unbind · 5de85b9d
      Ulf Hansson 提交于
      There are two common expectations among several subsystems/drivers that
      deploys runtime PM support, but which isn't met by the driver core.
      
      Expectation 1)
      At ->probe() the subsystem/driver expects the runtime PM status of the
      device to be RPM_SUSPENDED, which is the initial status being assigned at
      device registration.
      
      This expectation is especially common among some of those subsystems/
      drivers that manages devices with an attached PM domain, as those requires
      the ->runtime_resume() callback at the PM domain level to be invoked
      during ->probe().
      
      Moreover these subsystems/drivers entirely relies on runtime PM resources
      being managed at the PM domain level, thus don't implement their own set
      of runtime PM callbacks.
      
      These are two scenarios that suffers from this unmet expectation.
      
      i) A failed ->probe() sequence requests probe deferral:
      
      ->probe()
        ...
        pm_runtime_enable()
        pm_runtime_get_sync()
        ...
      
      err:
        pm_runtime_put()
        pm_runtime_disable()
        ...
      
      As there are no guarantees that such sequence turns the runtime PM status
      of the device into RPM_SUSPENDED, the re-trying ->probe() may start with
      the status in RPM_ACTIVE.
      
      In such case the runtime PM core won't invoke the ->runtime_resume()
      callback because of a pm_runtime_get_sync(), as it considers the device to
      be already runtime resumed.
      
      ii) A driver re-bind sequence:
      
      At driver unbind, the subsystem/driver's >remove() callback invokes a
      sequence of runtime PM APIs, to undo actions during ->probe() and to put
      the device into low power state.
      
      ->remove()
        ...
        pm_runtime_put()
        pm_runtime_disable()
        ...
      
      Similar as in the failing ->probe() case, this sequence don't guarantee
      the runtime PM status of the device to turn into RPM_SUSPENDED.
      
      Trying to re-bind the driver thus causes the same issue as when re-trying
      ->probe(), in the probe deferral scenario.
      
      Expectation 2)
      Drivers that invokes the pm_runtime_irq_safe() API during ->probe(),
      triggers the runtime PM core to increase the usage count for the device's
      parent and permanently make it runtime resumed.
      
      The usage count is only dropped at device removal, which also allows it to
      be runtime suspended again.
      
      A re-trying ->probe() repeats the call to pm_runtime_irq_safe() and thus
      once more triggers the usage count of the device's parent to be increased.
      
      This leads to not only an imbalance issue of the usage count of the
      device's parent, but also to keep it runtime resumed permanently even if
      ->probe() fails.
      
      To address these issues, let's change the policy of the driver core to
      meet these expectations. More precisely, at ->probe() failures and driver
      unbind, restore the initial states of runtime PM.
      
      Although to still allow subsystem's to control PM for devices that doesn't
      ->probe() successfully, don't restore the initial states unless runtime PM
      is disabled.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5de85b9d
    • S
      PM / sleep: prohibit devices probing during suspend/hibernation · 013c074f
      Strashko, Grygorii 提交于
      It is unsafe [1] if probing of devices will happen during suspend or
      hibernation and system behavior will be unpredictable in this case.
      So, let's prohibit device's probing in dpm_prepare() and defer their
      probing instead. The normal behavior will be restored in
      dpm_complete().
      
      This patch introduces new DD core APIs:
       device_block_probing()
         It will disable probing of devices and defer their probes instead.
       device_unblock_probing()
         It will restore normal behavior and trigger re-probing of deferred
         devices.
      
      [1] https://lkml.org/lkml/2015/9/11/554Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      013c074f
  9. 17 11月, 2015 1 次提交
  10. 07 11月, 2015 6 次提交
  11. 02 11月, 2015 5 次提交
  12. 31 10月, 2015 1 次提交
    • J
      PM / OPP: get the voltage for all OPPs · d6d00742
      Javi Merino 提交于
      The OPP library is now used for power models to calculate the power
      that a device would consume at a specific OPP.  To do that, we use a
      simple power model which takes frequency and voltage as inputs.  We get
      the voltage and frequency from the OPP library.
      
      The devfreq cooling device for the thermal framework controls
      temperature by disabling OPPs.  The power model needs to calculate the
      power that would be consumed if we reenabled the OPP.  Therefore, let
      dev_pm_opp_get_voltage() work for disabled OPPs.
      
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NJavi Merino <javi.merino@arm.com>
      Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
      d6d00742
  13. 28 10月, 2015 3 次提交
    • U
      PM / Domains: Merge measurements for PM QoS device latencies · 2b1d88cd
      Ulf Hansson 提交于
      Measure latency does by itself contribute to an increased latency, thus we
      should avoid it when it isn't needed.
      
      By merging the latency measurements for the ->save_state() and the
      ->stop() callbacks, we get one measurement instead of two and we get one
      value to store instead of two. Let's also apply the likewise change for
      the ->start() and ->restore_state() callbacks.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NLina Iyer <lina.iyer@linaro.org>
      Acked-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2b1d88cd
    • U
      PM / Domains: Don't measure ->start|stop() latency in system PM callbacks · 51cda844
      Ulf Hansson 提交于
      Measure latency does by itself contribute to an increased latency, thus we
      should avoid it when it isn't needed.
      
      Genpd measures latencies in the system PM phase for the ->start|stop()
      callbacks and is thus affecting the system PM suspend/resume time.
      Moreover these latencies are validated only at runtime PM suspend/resume.
      
      To this reasoning, let's decide to leave these measurements out of the
      system PM phase. There should be plenty of occasions during runtime PM to
      perform these measurements anyway.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NLina Iyer <lina.iyer@linaro.org>
      Acked-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      51cda844
    • G
      PM / clk: Fix broken build due to non-matching code and header #ifdefs · a6175616
      Geert Uytterhoeven 提交于
      If an architecture's main Kconfig file doesn't include
      kernel/power/Kconfig, but CONFIG_PM=y and HAVE_CLK=y (e.g. m68knommu
      allmodconfig):
      
          drivers/base/power/clock_ops.c: In function ‘__pm_clk_add’:
          drivers/base/power/clock_ops.c:106: error: ‘struct pm_subsys_data’ has no member named ‘clock_list’
          drivers/base/power/clock_ops.c: At top level:
          drivers/base/power/clock_ops.c:120: error: redefinition of ‘pm_clk_add’
          include/linux/pm_clock.h:64: error: previous definition of ‘pm_clk_add’ was here
          drivers/base/power/clock_ops.c:135: error: redefinition of ‘pm_clk_add_clk’
          include/linux/pm_clock.h:69: error: previous definition of ‘pm_clk_add_clk’ was here
          drivers/base/power/clock_ops.c:171: error: redefinition of ‘pm_clk_remove’
          include/linux/pm_clock.h:73: error: previous definition of ‘pm_clk_remove’ was here
          drivers/base/power/clock_ops.c: In function ‘pm_clk_remove’:
          drivers/base/power/clock_ops.c:180: error: ‘struct pm_subsys_data’ has no member named ‘clock_list’
          drivers/base/power/clock_ops.c:180: error: ‘struct pm_subsys_data’ has no member named ‘clock_list’
          drivers/base/power/clock_ops.c: At top level:
          drivers/base/power/clock_ops.c:207: error: redefinition of ‘pm_clk_init’
          include/linux/pm_clock.h:54: error: previous definition of ‘pm_clk_init’ was here
          drivers/base/power/clock_ops.c: In function ‘pm_clk_init’:
          drivers/base/power/clock_ops.c:210: error: ‘struct pm_subsys_data’ has no member named ‘clock_list’
          drivers/base/power/clock_ops.c: At top level:
          drivers/base/power/clock_ops.c:221: error: redefinition of ‘pm_clk_create’
          include/linux/pm_clock.h:57: error: previous definition of ‘pm_clk_create’ was here
          drivers/base/power/clock_ops.c:234: error: redefinition of ‘pm_clk_destroy’
          include/linux/pm_clock.h:61: error: previous definition of ‘pm_clk_destroy’ was here
          drivers/base/power/clock_ops.c: In function ‘pm_clk_destroy’:
          drivers/base/power/clock_ops.c:246: error: ‘struct pm_subsys_data’ has no member named ‘clock_list’
          drivers/base/power/clock_ops.c:246: error: ‘struct pm_subsys_data’ has no member named ‘clock_list’
          drivers/base/power/clock_ops.c: At top level:
          drivers/base/power/clock_ops.c:263: error: expected identifier or ‘(’ before ‘void’
          drivers/base/power/clock_ops.c:263: error: expected ‘)’ before numeric constant
          drivers/base/power/clock_ops.c:293: error: expected identifier or ‘(’ before ‘void’
          drivers/base/power/clock_ops.c:293: error: expected ‘)’ before numeric constant
          drivers/base/power/clock_ops.c: In function ‘pm_clk_runtime_suspend’:
          drivers/base/power/clock_ops.c:384: error: called object ‘0u’ is not a function
          drivers/base/power/clock_ops.c: In function ‘pm_clk_runtime_resume’:
          drivers/base/power/clock_ops.c:400: error: called object ‘0u’ is not a function
      
      This happens because:
        - drivers/base/power/clock_ops.c depends on CONFIG_HAVE_CLK,
        - the failing code inside clock_ops.c additionally depends on
          CONFIG_PM,
        - the forward declarations and other definitions in <linux/pm_clock.h>
          depend on CONFIG_PM_CLK,
        - CONFIG_PM_CLK is defined as PM && HAVE_CLK in kernel/power/Kconfig,
          but it is not included on all architectures.
      
      Fix this by protecting the failing code inside clock_ops.c by
      CONFIG_PM_CLK instead of CONFIG_PM, so it matches <linux/pm_clock.h>.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a6175616
  14. 27 10月, 2015 1 次提交
    • D
      drivers/pinctrl: Add the concept of an "init" state · ef0eebc0
      Douglas Anderson 提交于
      For pinctrl the "default" state is applied to pins before the driver's
      probe function is called.  This is normally a sensible thing to do,
      but in some cases can cause problems.  That's because the pins will
      change state before the driver is given a chance to program how those
      pins should behave.
      
      As an example you might have a regulator that is controlled by a PWM
      (output high = high voltage, output low = low voltage).  The firmware
      might leave this pin as driven high.  If we allow the driver core to
      reconfigure this pin as a PWM pin before the PWM's probe function runs
      then you might end up running at too low of a voltage while we probe.
      
      Let's introudce a new "init" state.  If this is defined we'll set
      pinctrl to this state before probe and then "default" after probe
      (unless the driver explicitly changed states already).
      
      An alternative idea that was thought of was to use the pre-existing
      "sleep" or "idle" states and add a boolean property that we should
      start in that mode.  This was not done because the "init" state is
      needed for correctness and those other states are only present (and
      only transitioned in to and out of) when (optional) power management
      is enabled.
      
      Changes in v3:
      - Moved declarations to pinctrl/devinfo.h
      - Fixed author/SoB
      
      Changes in v2:
      - Added comment to pinctrl_init_done() as per Linus W.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: NCaesar Wang <wxt@rock-chips.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ef0eebc0
  15. 23 10月, 2015 1 次提交
  16. 18 10月, 2015 1 次提交
  17. 14 10月, 2015 6 次提交
  18. 13 10月, 2015 3 次提交