1. 06 Sep, 2012 1 commit
  2. 03 Sep, 2012 20 commits
    • Rafael J. Wysocki's avatar
      PM / Domains: Operations related to cpuidle using domain names · 74a2799a
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      74a2799a
    • Rafael J. Wysocki's avatar
      PM / Domains: Document cpuidle-related functions and change their names · 40114447
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      40114447
    • Rafael J. Wysocki's avatar
      PM / Domains: Add power-on function using names to identify domains · 8bc0251d
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      8bc0251d
    • Rafael J. Wysocki's avatar
      PM / Domains: Make it possible to use names when adding subdomains · fb7268be
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      fb7268be
    • Rafael J. Wysocki's avatar
      PM / Domains: Make it possible to use domain names when adding devices · b5abb085
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      b5abb085
    • Rafael J. Wysocki's avatar
      PM: Do not use the syscore flag for runtime PM · feb70af0
      Rafael J. Wysocki authored
      The syscore device PM flag used to mark the devices (belonging to
      PM domains) that should never be turned off, except for the system
      core (syscore) suspend/hibernation and resume stages, need not be
      accessed by the runtime PM core functions, because all of the devices
      it is set for need to be marked as "irq safe" anyway and are
      protected from being turned off by runtime PM by ensuring that their
      usage counters are always set.
      
      For this reason, make the syscore flag system-wide PM-specific
      and simplify the code used for manipulating it, because it need not
      acquire the device's power.lock any more.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      feb70af0
    • Rafael J. Wysocki's avatar
      sh: MTU2: Basic runtime PM support · 3cb6f10a
      Rafael J. Wysocki authored
      Modify the SH MTU2 clock event device driver to support runtime PM at
      a basic level (i.e. device clocks can be disabled and enabled, but
      domain power must be on, because the device has to be marked as
      "irq safe").
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      3cb6f10a
    • Rafael J. Wysocki's avatar
      sh: CMT: Basic runtime PM support · bad81383
      Rafael J. Wysocki authored
      Modify the SH CMT clock source/clock event device driver to support
      runtime PM at a basic level (i.e. device clocks can be disabled and
      enabled, but domain power must be on, because the devices have to
      be marked as "irq safe").
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      bad81383
    • Rafael J. Wysocki's avatar
      sh: TMU: Basic runtime PM support · 61a53bfa
      Rafael J. Wysocki authored
      Modify the SH TMU clock source/clock event device driver to support
      runtime PM at a basic level (i.e. device clocks can be disabled and
      enabled, but domain power must be on, because the devices have to
      be marked as "irq safe").
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      61a53bfa
    • Rafael J. Wysocki's avatar
      PM / Domains: Do not measure start time for "irq safe" devices · e2e3e4e5
      Rafael J. Wysocki authored
      The genpd_start_dev() routine used by pm_genpd_runtime_resume()
      to put "irq safe" devices into the full power state measures the
      time necessary to "start" the device and updates its PM QoS timing
      data if necessary.  This may lead to a deadlock if the given device
      is a clock source and genpd_start_dev() is invoked from within the
      clock source's .enable() routine, which will happen if that routine
      uses pm_runtime_get_sync(), for example, to ensure that the device
      is operational.
      
      For this reason, introduce a special routine analogous to
      genpd_start_dev(), called genpd_start_dev_no_timing(), that doesn't
      carry out the time measurement, and make pm_genpd_runtime_resume()
      use it instead of genpd_start_dev() to power up "irq safe" devices.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      e2e3e4e5
    • Rafael J. Wysocki's avatar
      PM / Domains: Move syscore flag from subsys data to struct device · dbf37414
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      dbf37414
    • Rafael J. Wysocki's avatar
      PM / Domains: Rename the always_on device flag to syscore · 6fb28bad
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      6fb28bad
    • Rafael J. Wysocki's avatar
      PM / Runtime: Allow helpers to be called by early platform drivers · bed2b42d
      Rafael J. Wysocki authored
      Runtime PM helper functions, like pm_runtime_get_sync(), cannot be
      called by early platform device drivers, because the devices' power
      management locks are not initialized at that time.  This is quite
      inconvenient, so modify early_platform_add_devices() to initialize
      the devices power management locks as appropriate and make sure that
      they won't be initialized more than once if an early platform
      device is going to be used as a regular one later.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      bed2b42d
    • Rafael J. Wysocki's avatar
      PM: Reorganize device PM initialization · e91c11b1
      Rafael J. Wysocki authored
      Make the device power management initialization more straightforward
      by moving the initialization of common (i.e. used by both runtime PM
      and system suspend) fields to a separate routine.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      e91c11b1
    • Rafael J. Wysocki's avatar
      sh: MTU2: Introduce clock events suspend/resume routines · cc7ad456
      Rafael J. Wysocki authored
      Introduce suspend/resume routines for SH MTU2 clock event devices
      such that if those devices belong to a PM domain, the generic PM
      domains framework will be notified that the given domain may be
      turned off (during system suspend) or that it has to be turned on
      (during system resume).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      cc7ad456
    • Rafael J. Wysocki's avatar
      sh: CMT: Introduce clocksource/clock events suspend/resume routines · 9bb5ec88
      Rafael J. Wysocki authored
      Introduce suspend/resume routines for SH CMT clock event devices and
      modify the suspend/resume routines for SH CMT clock sources such that
      if those devices belong to a PM domain, the generic PM domains
      framework will be notified that the given domain may be turned off
      (during system suspend) or that it has to be turned on (during system
      resume).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      9bb5ec88
    • Rafael J. Wysocki's avatar
      sh: TMU: Introduce clocksource/clock events suspend/resume routines · eaa49a8c
      Rafael J. Wysocki authored
      Introduce suspend/resume routines for SH TMU clock source and
      clock event device such that if those devices belong to a PM domain,
      the generic PM domains framework will be notified that the given
      domain may be turned off (during system suspend) or that it has to
      be turned on (during system resume).
      
      This change allows the A4R domain on SH7372 to be turned off during
      system suspend (tested on the Mackerel board) if the TMU clock source
      and/or clock event device is in use.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      eaa49a8c
    • Rafael J. Wysocki's avatar
      timekeeping: Add suspend and resume of clock event devices · adc78e6b
      Rafael J. Wysocki authored
      Some clock event devices, for example such that belong to PM domains,
      need to be handled in a spcial way during the timekeeping suspend
      and resume (which takes place in the system core, or "syscore",
      stages of system power transitions) in analogy with clock sources.
      
      Introduce .suspend() and .resume() callbacks for clock event devices
      that will be executed by timekeeping_suspend/_resume(), respectively,
      next the the clock sources' .suspend() and .resume() callbacks.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      adc78e6b
    • Rafael J. Wysocki's avatar
      PM / Domains: Add power off/on function for system core suspend stage · 77f827de
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      77f827de
    • Rafael J. Wysocki's avatar
      PM / Domains: Introduce simplified power on routine for system resume · 802d8b49
      Rafael J. Wysocki authored
      Introduce function pm_genpd_sync_poweron() for restoring domain power
      during resume from system suspend and hibernation.  It can be much
      simpler than pm_genpd_poweron(), because it doesn't have to care
      about locking and it can skip many checks done by the latter.
      
      Modify pm_genpd_resume_noirq() and pm_genpd_restore_noirq() to use
      the new function.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      802d8b49
  3. 01 Sep, 2012 5 commits
  4. 30 Aug, 2012 5 commits
  5. 29 Aug, 2012 9 commits