1. 30 9月, 2014 1 次提交
  2. 26 9月, 2014 2 次提交
  3. 22 9月, 2014 1 次提交
  4. 09 9月, 2014 8 次提交
  5. 03 9月, 2014 1 次提交
  6. 04 9月, 2012 8 次提交
    • R
      PM / Domains: Operations related to cpuidle using domain names · 74a2799a
      Rafael J. Wysocki 提交于
      Make it possible to use domain names in operations connecting cpuidle
      to and disconnecting it from a PM domain.  This is useful on
      platforms where PM domain objects are organized in such a way that
      the names of the domains are easier to use than the addresses of
      those objects.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      74a2799a
    • R
      PM / Domains: Document cpuidle-related functions and change their names · 40114447
      Rafael J. Wysocki 提交于
      The names of the cpuidle-related functions in
      drivers/base/power/domain.c are inconsistent with the names of the
      other exported functions in that file (the "pm_" prefix is missing
      from them) and they are missing kerneldoc comments.
      
      Fix that by adding the missing "pm_" prefix to the names of those
      functions and add kerneldoc comments documenting them.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      40114447
    • R
      PM / Domains: Add power-on function using names to identify domains · 8bc0251d
      Rafael J. Wysocki 提交于
      It sometimes is necessary to turn on a given PM domain when only
      the name of it is known and the domain pointer is not readily
      available.  For this reason, add a new helper function,
      pm_genpd_name_poweron(), allowing the caller to turn on a PM domain
      using its name for identification.  To avoid code duplication,
      move the domain lookup code to a separate function.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      8bc0251d
    • R
      PM / Domains: Make it possible to use names when adding subdomains · fb7268be
      Rafael J. Wysocki 提交于
      Add a new helper function, pm_genpd_add_subdomain_names(), allowing
      the caller to add a subdomain to a generic PM domain using names for
      domain identification (both domains have to be initialized before).
      
      This function is useful for adding subdomains to PM domains whose
      representations are stored in tables, when the caller doesn't know
      the indices of the domain to add the subdomain to and of the
      subdomain itself, but it knows the domains' names.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      fb7268be
    • R
      PM / Domains: Make it possible to use domain names when adding devices · b5abb085
      Rafael J. Wysocki 提交于
      Add a new helper function __pm_genpd_name_add_device() allowing
      a device to be added to a (registered) generic PM domain identified
      by name.  Add a wrapper around it, pm_genpd_name_add_device(),
      passing NULL as the last argument and reorganize pm_domains.h for the
      new functions to be defined consistently with the existing ones.
      
      These functions are useful for adding devices to PM domains whose
      representations are stored in tables, when the caller doesn't know
      the index of the domain to add the device to, but it knows the
      domain's name.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      b5abb085
    • R
      PM / Domains: Move syscore flag from subsys data to struct device · dbf37414
      Rafael J. Wysocki 提交于
      The syscore device PM flag is used to mark the devices (belonging to
      a PM domain) that should never be turned off, except for the system
      core (syscore) suspend/hibernation and resume stages.  That flag is
      stored in the device's struct pm_subsys_data object whose address is
      available from struct device.  However, in some situations it may be
      convenient to set that flag before the device is added to a PM
      domain, so it is better to move it directly to the "power" member of
      struct device.  Then, it can be checked by the routines in
      drivers/base/power/runtime.c and drivers/base/power/main.c, which is
      more straightforward.
      
      This also reduces the number of dev_gpd_data() invocations in the
      generic PM domains framework, so the overhead related to the syscore
      flag is slightly smaller.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      dbf37414
    • R
      PM / Domains: Rename the always_on device flag to syscore · 6fb28bad
      Rafael J. Wysocki 提交于
      The always_on device flag is used to mark the devices (belonging to
      a PM domain) that should never be turned off, except for the system
      core (syscore) suspend/hibernation and resume stages.  Change name
      of that flag to "syscore" to better reflect its purpose.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      6fb28bad
    • R
      PM / Domains: Add power off/on function for system core suspend stage · 77f827de
      Rafael J. Wysocki 提交于
      Introduce function pm_genpd_syscore_switch() and two wrappers around
      it, pm_genpd_syscore_poweroff() and pm_genpd_syscore_poweron(),
      allowing the callers to let the generic PM domains framework know
      that the given device is not necessary any more and its PM domain
      can be turned off (the former) or that the given device will be
      required immediately, so its PM domain has to be turned on (the
      latter) during the system core (syscore) stage of system suspend
      (or hibernation) and resume.
      
      These functions will be used for handling devices registered as
      clock sources and clock event devices that belong to PM domains.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      77f827de
  7. 06 7月, 2012 1 次提交
    • R
      PM / Domains: Add device domain data reference counter · 1d5fcfec
      Rafael J. Wysocki 提交于
      Add a mechanism for counting references to the
      struct generic_pm_domain_data object pointed to by
      dev->power.subsys_data->domain_data if the device in question
      belongs to a generic PM domain.
      
      This change is necessary for a subsequent patch making it possible to
      allocate that object from within pm_genpd_add_callbacks(), so that
      drivers can attach their PM domain device callbacks to devices before
      those devices are added to PM domains.
      
      This patch has been tested on the SH7372 Mackerel board.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1d5fcfec
  8. 04 7月, 2012 1 次提交
    • R
      PM / Domains: Add preliminary support for cpuidle, v2 · cbc9ef02
      Rafael J. Wysocki 提交于
      On some systems there are CPU cores located in the same power
      domains as I/O devices.  Then, power can only be removed from the
      domain if all I/O devices in it are not in use and the CPU core
      is idle.  Add preliminary support for that to the generic PM domains
      framework.
      
      First, the platform is expected to provide a cpuidle driver with one
      extra state designated for use with the generic PM domains code.
      This state should be initially disabled and its exit_latency value
      should be set to whatever time is needed to bring up the CPU core
      itself after restoring power to it, not including the domain's
      power on latency.  Its .enter() callback should point to a procedure
      that will remove power from the domain containing the CPU core at
      the end of the CPU power transition.
      
      The remaining characteristics of the extra cpuidle state, referred to
      as the "domain" cpuidle state below, (e.g. power usage, target
      residency) should be populated in accordance with the properties of
      the hardware.
      
      Next, the platform should execute genpd_attach_cpuidle() on the PM
      domain containing the CPU core.  That will cause the generic PM
      domains framework to treat that domain in a special way such that:
      
       * When all devices in the domain have been suspended and it is about
         to be turned off, the states of the devices will be saved, but
         power will not be removed from the domain.  Instead, the "domain"
         cpuidle state will be enabled so that power can be removed from
         the domain when the CPU core is idle and the state has been chosen
         as the target by the cpuidle governor.
      
       * When the first I/O device in the domain is resumed and
         __pm_genpd_poweron(() is called for the first time after
         power has been removed from the domain, the "domain" cpuidle
         state will be disabled to avoid subsequent surprise power removals
         via cpuidle.
      
      The effective exit_latency value of the "domain" cpuidle state
      depends on the time needed to bring up the CPU core itself after
      restoring power to it as well as on the power on latency of the
      domain containing the CPU core.  Thus the "domain" cpuidle state's
      exit_latency has to be recomputed every time the domain's power on
      latency is updated, which may happen every time power is restored
      to the domain, if the measured power on latency is greater than
      the latency stored in the corresponding generic_pm_domain structure.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      cbc9ef02
  9. 19 5月, 2012 1 次提交
    • R
      PM / Domains: Make it possible to add devices to inactive domains · ca1d72f0
      Rafael J. Wysocki 提交于
      The generic PM domains core code currently requires domains to be in
      the "power on" state for adding devices to them, but this limitation
      turns out to be inconvenient in some situations, so remove it.
      
      For this purpose, make __pm_genpd_add_device() set the device's
      need_restore flag if the domain is in the "power off" state, so that
      the device's "restore state" (usually .runtime_resume()) callback
      is executed when it is resumed after the domain has been turned on.
      If the domain is in the "power on" state, the device's need_restore
      flag will be cleared by __pm_genpd_add_device(), so that its "save
      state" (usually .runtime_suspend()) callback is executed when the
      domain is about to be turned off.  However, since that default
      behavior need not be always desirable, add a helper function
      pm_genpd_dev_need_restore() allowing a device's need_restore flag
      to be set/unset at any time.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      ca1d72f0
  10. 06 5月, 2012 1 次提交
    • R
      PM / Domains: Cache device stop and domain power off governor results, v3 · 6ff7bb0d
      Rafael J. Wysocki 提交于
      The results of the default device stop and domain power off governor
      functions for generic PM domains, default_stop_ok() and
      default_power_down_ok(), depend only on the timing data of devices,
      which are static, and on their PM QoS constraints.  Thus, in theory,
      these functions only need to carry out their computations, which may
      be time consuming in general, when it is known that the PM QoS
      constraint of at least one of the devices in question has changed.
      
      Use the PM QoS notifiers of devices to implement that.  First,
      introduce new fields, constraint_changed and max_off_time_changed,
      into struct gpd_timing_data and struct generic_pm_domain,
      respectively, and register a PM QoS notifier function when adding
      a device into a domain that will set those fields to 'true' whenever
      the device's PM QoS constraint is modified.  Second, make
      default_stop_ok() and default_power_down_ok() use those fields to
      decide whether or not to carry out their computations from scratch.
      
      The device and PM domain hierarchies are taken into account in that
      and the expense is that the changes of PM QoS constraints of
      suspended devices will not be taken into account immediately, which
      isn't guaranteed anyway in general.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      6ff7bb0d
  11. 02 5月, 2012 2 次提交
    • R
      PM / Domains: Rework default domain power off governor function, v2 · dd8683e9
      Rafael J. Wysocki 提交于
      The existing default domain power down governor function for PM
      domains, default_power_down_ok(), is supposed to check whether or not
      the PM QoS latency constraints of the devices in the domain will be
      violated if the domain is turned off by pm_genpd_poweroff().
      However, the computations carried out by it don't reflect the
      definition of the PM QoS latency constrait in
      Documentation/ABI/testing/sysfs-devices-power.
      
      Make default_power_down_ok() follow the definition of the PM QoS
      latency constrait.  In particular, make it only take latencies into
      account, because it doesn't matter how much time has elapsed since
      the domain's devices were suspended for the computation.
      
      Remove the break_even_ns and power_off_time fields from
      struct generic_pm_domain, because they are not necessary any more.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      dd8683e9
    • R
      PM / Domains: Rework default device stop governor function, v2 · a5bef810
      Rafael J. Wysocki 提交于
      The existing default device stop governor function for PM domains,
      default_stop_ok(), is supposed to check whether or not the device's
      PM QoS latency constraint will be violated if the device is stopped
      by pm_genpd_runtime_suspend().  However, the computations carried out
      by it don't reflect the definition of the PM QoS latency constrait in
      Documentation/ABI/testing/sysfs-devices-power.
      
      Make default_stop_ok() follow the definition of the PM QoS latency
      constrait.  In particular, make it take the device's start and stop
      latencies correctly.
      
      Add a new field, effective_constraint_ns, to struct gpd_timing_data
      and use it to store the difference between the device's PM QoS
      constraint and its resume latency for use by the device's parent
      (the effective_constraint_ns values for the children are used for
      computing the parent's one along with its PM QoS constraint).
      
      Remove the break_even_ns field from struct gpd_timing_data, because
      it's not used any more.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      a5bef810
  12. 17 3月, 2012 1 次提交
    • R
      PM / Domains: Introduce "always on" device flag · 1e78a0c7
      Rafael J. Wysocki 提交于
      The TMU device on the Mackerel board belongs to the A4R power domain
      and loses power when the domain is turned off.  Unfortunately, the
      TMU driver is not prepared to cope with such situations and crashes
      the system when that happens.  To work around this problem introduce
      a new helper function, pm_genpd_dev_always_on(), allowing a device
      driver to mark its device as "always on" in case it belongs to a PM
      domain, which will make the generic PM domains core code avoid
      powering off the domain containing the device, both at run time and
      during system suspend.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: NSimon Horman <horms@verge.net.au>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Cc: stable@vger.kernel.org
      1e78a0c7
  13. 16 3月, 2012 1 次提交
    • P
      device.h: audit and cleanup users in main include dir · 313162d0
      Paul Gortmaker 提交于
      The <linux/device.h> header includes a lot of stuff, and
      it in turn gets a lot of use just for the basic "struct device"
      which appears so often.
      
      Clean up the users as follows:
      
      1) For those headers only needing "struct device" as a pointer
      in fcn args, replace the include with exactly that.
      
      2) For headers not really using anything from device.h, simply
      delete the include altogether.
      
      3) For headers relying on getting device.h implicitly before
      being included themselves, now explicitly include device.h
      
      4) For files in which doing #1 or #2 uncovers an implicit
      dependency on some other header, fix by explicitly adding
      the required header(s).
      
      Any C files that were implicitly relying on device.h to be
      present have already been dealt with in advance.
      
      Total removals from #1 and #2: 51.  Total additions coming
      from #3: 9.  Total other implicit dependencies from #4: 7.
      
      As of 3.3-rc1, there were 110, so a net removal of 42 gives
      about a 38% reduction in device.h presence in include/*
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      313162d0
  14. 05 3月, 2012 1 次提交
  15. 10 2月, 2012 1 次提交
  16. 27 1月, 2012 1 次提交
    • T
      PM / Domains: Add OF support · c8aa130b
      Thomas Abraham 提交于
      A device node pointer is added to generic pm domain structure to associate
      the domain with a node in the device tree. The platform code parses the
      device tree to find available nodes representing the generic power domain,
      instantiates the available domains and initializes them by calling
      pm_genpd_init().
      
      Nodes representing the devices include a phandle of the power domain to
      which it belongs. As these devices get instantiated, the driver code
      checkes for availability of a power domain phandle, converts the phandle
      to a device node and uses the new pm_genpd_of_add_device() api to
      associate the device with a power domain.
      
      pm_genpd_of_add_device() runs through its list of registered power domains
      and matches the OF node of the domain with the one specified as the
      parameter. If a match is found, the device is associated with the matched
      domain.
      
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NThomas Abraham <thomas.abraham@linaro.org>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      c8aa130b
  17. 10 12月, 2011 1 次提交
  18. 07 12月, 2011 1 次提交
  19. 02 12月, 2011 6 次提交
    • G
      PM / Domains: fix compilation failure for CONFIG_PM_GENERIC_DOMAINS unset · 4f042cda
      Guennadi Liakhovetski 提交于
      Fix the following compalitaion breakage:
      
      In file included from linux/drivers/sh/pm_runtime.c:15:
      linux/include/linux/pm_domain.h: In function 'dev_to_genpd':
      linux/include/linux/pm_domain.h:142: error: implicit declaration of function 'ERR_PTR'
      linux/include/linux/pm_domain.h:142: warning: return makes pointer from integer without a cast
      In file included from linux/include/linux/sh_clk.h:10,
                       from linux/drivers/sh/pm_runtime.c:19:
      linux/include/linux/err.h: At top level:
      linux/include/linux/err.h:22: error: conflicting types for 'ERR_PTR'
      linux/include/linux/pm_domain.h:142: note: previous implicit declaration of 'ERR_PTR' was here
      make[3]: *** [drivers/sh/pm_runtime.o] Error 1
      Reported-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      4f042cda
    • R
      PM / Domains: Add default power off governor function (v4) · 221e9b58
      Rafael J. Wysocki 提交于
      Add a function deciding whether or not a given PM domain should
      be powered off on the basis of the PM QoS constraints of devices
      belonging to it and their PM QoS timing data.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      221e9b58
    • R
      PM / Domains: Add device stop governor function (v4) · b02c999a
      Rafael J. Wysocki 提交于
      Add a function deciding whether or not devices should be stopped in
      pm_genpd_runtime_suspend() depending on their PM QoS constraints
      and stop/start timing values.  Make it possible to add information
      used by this function to device objects.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      b02c999a
    • R
      PM / Domains: Rework system suspend callback routines (v2) · d23b9b00
      Rafael J. Wysocki 提交于
      The current generic PM domains code attempts to use the generic
      system suspend operations along with the domains' device stop/start
      routines, which requires device drivers to assume that their
      system suspend/resume (and hibernation/restore) callbacks will always
      be used with generic PM domains.  However, in theory, the same
      hardware may be used in devices that don't belong to any PM domain,
      in which case it would be necessary to add "fake" PM domains to
      satisfy the above assumption.  Also, the domain the hardware belongs
      to may not be handled with the help of the generic code.
      
      To allow device drivers that may be used along with the generic PM
      domains code of more flexibility, add new device callbacks,
      .suspend(), .suspend_late(), .resume_early(), .resume(), .freeze(),
      .freeze_late(), .thaw_early(), and .thaw(), that can be supplied by
      the drivers in addition to their "standard" system suspend and
      hibernation callbacks.  These new callbacks, if defined, will be used
      by the generic PM domains code for the handling of system suspend and
      hibernation instead of the "standard" ones.  This will allow drivers
      to be designed to work with generic PM domains as well as without
      them.
      
      For backwards compatibility, introduce default implementations of the
      new callbacks for PM domains that will execute pm_generic_suspend(),
      pm_generic_suspend_noirq(), pm_generic_resume_noirq(),
      pm_generic_resume(), pm_generic_freeze(), pm_generic_freeze_noirq(),
      pm_generic_thaw_noirq(), and pm_generic_thaw(), respectively, for the
      given device if its driver doesn't define those callbacks.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      d23b9b00
    • R
      PM / Domains: Introduce "save/restore state" device callbacks · ecf00475
      Rafael J. Wysocki 提交于
      The current PM domains code uses device drivers' .runtime_suspend()
      and .runtime_resume() callbacks as the "save device state" and
      "restore device state" operations, which may not be appropriate in
      general, because it forces drivers to assume that they always will
      be used with generic PM domains.  However, in theory, the same
      hardware may be used in devices that don't belong to any PM
      domain, in which case it would be necessary to add "fake" PM
      domains to satisfy the above assumption.  It also may be located in
      a PM domain that's not handled with the help of the generic code.
      
      To allow device drivers that may be used along with the generic PM
      domains code of more flexibility, introduce new device callbacks,
      .save_state() and .restore_state(), that can be supplied by the
      drivers in addition to their "standard" runtime PM callbacks.  This
      will allow the drivers to be designed to work with generic PM domains
      as well as without them.
      
      For backwards compatibility, introduce default .save_state() and
      .restore_state() callback routines for PM domains that will execute
      a device driver's .runtime_suspend() and .runtime_resume() callbacks,
      respectively, for the given device if the driver doesn't provide its
      own implementations of .save_state() and .restore_state().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      ecf00475
    • R
      PM / Domains: Make it possible to use per-device domain callbacks · d5e4cbfe
      Rafael J. Wysocki 提交于
      The current generic PM domains code requires that the same .stop(),
      .start() and .active_wakeup() device callback routines be used for
      all devices in the given domain, which is inflexible and may not
      cover some specific use cases.  For this reason, make it possible to
      use device specific .start()/.stop() and .active_wakeup() callback
      routines by adding corresponding callback pointers to struct
      generic_pm_domain_data.  Add a new helper routine,
      pm_genpd_register_callbacks(), that can be used to populate
      the new per-device callback pointers.
      
      Modify the shmobile's power domains code to allow drivers to add
      their own code to be run during the device stop and start operations
      with the help of the new callback pointers.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      d5e4cbfe