1. 11 11月, 2012 1 次提交
  2. 02 11月, 2012 2 次提交
  3. 31 10月, 2012 1 次提交
  4. 24 10月, 2012 1 次提交
    • R
      PM / QoS: Make it possible to expose PM QoS device flags to user space · e39473d0
      Rafael J. Wysocki 提交于
      Define two device PM QoS flags, PM_QOS_FLAG_NO_POWER_OFF
      and PM_QOS_FLAG_REMOTE_WAKEUP, and introduce routines
      dev_pm_qos_expose_flags() and dev_pm_qos_hide_flags() allowing the
      caller to expose those two flags to user space or to hide them
      from it, respectively.
      
      After the flags have been exposed, user space will see two
      additional sysfs attributes, pm_qos_no_power_off and
      pm_qos_remote_wakeup, under the device's /sys/devices/.../power/
      directory.  Then, writing 1 to one of them will update the
      PM QoS flags request owned by user space so that the corresponding
      flag is requested to be set.  In turn, writing 0 to one of them
      will cause the corresponding flag in the user space's request to
      be cleared (however, the owners of the other PM QoS flags requests
      for the same device may still request the flag to be set and it
      may be effectively set even if user space doesn't request that).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NJean Pihet <j-pihet@ti.com>
      Acked-by: Nmark gross <markgross@thegnar.org>
      e39473d0
  5. 23 10月, 2012 3 次提交
    • R
      PM / QoS: Introduce PM QoS device flags support · ae0fb4b7
      Rafael J. Wysocki 提交于
      Modify the device PM QoS core code to support PM QoS flags requests.
      
      First, add a new field of type struct pm_qos_flags called "flags"
      to struct dev_pm_qos for representing the list of PM QoS flags
      requests for the given device.  Accordingly, add a new "type" field
      to struct dev_pm_qos_request (along with an enum for representing
      request types) and a new member called "flr" to its data union for
      representig flags requests.
      
      Second, modify dev_pm_qos_add_request(), dev_pm_qos_update_request(),
      the internal routine apply_constraint() used by them and their
      existing callers to cover flags requests as well as latency
      requests.  In particular, dev_pm_qos_add_request() gets a new
      argument called "type" for specifying the type of a request to be
      added.
      
      Finally, introduce two routines, __dev_pm_qos_flags() and
      dev_pm_qos_flags(), allowing their callers to check which PM QoS
      flags have been requested for the given device (the caller is
      supposed to pass the mask of flags to check as the routine's
      second argument and examine its return value for the result).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NJean Pihet <j-pihet@ti.com>
      Reviewed-by: Nmark gross <markgross@thegnar.org>
      ae0fb4b7
    • R
      PM / QoS: Prepare struct dev_pm_qos_request for more request types · 021c870b
      Rafael J. Wysocki 提交于
      The subsequent patches will use struct dev_pm_qos_request for
      representing both latency requests and flags requests.  To make that
      easier, put the node member of struct dev_pm_qos_request (under the
      name "pnode") into a union called "data" that will represent the
      request's  value and list node depending on its type.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NJean Pihet <j-pihet@ti.com>
      Reviewed-by: Nmark gross <markgross@thegnar.org>
      021c870b
    • R
      PM / QoS: Prepare device structure for adding more constraint types · 5f986c59
      Rafael J. Wysocki 提交于
      Currently struct dev_pm_info contains only one PM QoS constraints
      pointer reserved for latency requirements.  Since one more device
      constraints type (i.e. flags) will be necessary, introduce a new
      structure, struct dev_pm_qos, that eventually will contain all of
      the available device PM QoS constraints and replace the "constraints"
      pointer in struct dev_pm_info with a pointer to the new structure
      called "qos".
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NJean Pihet <j-pihet@ti.com>
      5f986c59
  6. 25 9月, 2012 1 次提交
  7. 19 9月, 2012 1 次提交
    • J
      PM QoS: Use spinlock in the per-device PM QoS constraints code · fc2fb3a0
      Jean Pihet 提交于
      The per-device PM QoS locking requires a spinlock to be used. The reasons
      are:
       - an alignement with the PM QoS core code, which is used by the per-device
         PM QoS code for the constraints lists management. The PM QoS core code
         uses spinlocks to protect the constraints lists,
       - some drivers need to use the per-device PM QoS functionality from
         interrupt context or spinlock protected context.
         An example of such a driver is the OMAP HSI (high-speed synchronous serial
         interface) driver which needs to control the IP block idle state
         depending on the FIFO empty state, from interrupt context.
      Reported-by: NDjamil Elaidi <d-elaidi@ti.com>
      Signed-off-by: NJean Pihet <j-pihet@ti.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      fc2fb3a0
  8. 19 7月, 2012 1 次提交
  9. 02 5月, 2012 1 次提交
    • R
      PM / QoS: Create device constraints objects on notifier registration · 23e0fc5a
      Rafael J. Wysocki 提交于
      The current behavior of dev_pm_qos_add_notifier() makes device PM QoS
      notifiers less than useful.  Namely, it silently returns success when
      called before any PM QoS constraints are added for the device, so the
      caller will assume that the notifier has been registered, but when
      someone actually adds some nontrivial constraints for the device
      eventually, the previous callers of dev_pm_qos_add_notifier()
      will not know about that and their notifier routines will not be
      executed (contrary to their expectations).
      
      To address this problem make dev_pm_qos_add_notifier() create the
      constraints object for the device if it is not present when the
      routine is called.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by : markgross <markgross@thegnar.org>
      23e0fc5a
  10. 14 3月, 2012 1 次提交
    • R
      PM / QoS: Make it possible to expose PM QoS latency constraints · 85dc0b8a
      Rafael J. Wysocki 提交于
      A runtime suspend of a device (e.g. an MMC controller) belonging to
      a power domain or, in a more complicated scenario, a runtime suspend
      of another device in the same power domain, may cause power to be
      removed from the entire domain.  In that case, the amount of time
      necessary to runtime-resume the given device (e.g. the MMC
      controller) is often substantially greater than the time needed to
      run its driver's runtime resume callback.  That may hurt performance
      in some situations, because user data may need to wait for the
      device to become operational, so we should make it possible to
      prevent that from happening.
      
      For this reason, introduce a new sysfs attribute for devices,
      power/pm_qos_resume_latency_us, allowing user space to specify the
      upper bound of the time necessary to bring the (runtime-suspended)
      device up after the resume of it has been requested.  However, make
      that attribute appear only for the devices whose drivers declare
      support for it by calling the (new) dev_pm_qos_expose_latency_limit()
      helper function with the appropriate initial value of the attribute.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      85dc0b8a
  11. 26 12月, 2011 1 次提交
    • R
      PM / QoS: Introduce dev_pm_qos_add_ancestor_request() · 40a5f8be
      Rafael J. Wysocki 提交于
      Some devices, like the I2C controller on SH7372, are not
      necessary for providing power to their children or forwarding
      wakeup signals (and generally interrupts) from them.  They are
      only needed by their children when there's some data to transfer,
      so they may be suspended for the majority of time and resumed
      on demand, when the children have data to send or receive.  For this
      purpose, however, their power.ignore_children flags have to be set,
      or the PM core wouldn't allow them to be suspended while their
      children were active.
      
      Unfortunately, in some situations it may take too much time to
      resume such devices so that they can assist their children in
      transferring data.  For example, if such a device belongs to a PM
      domain which goes to the "power off" state when that device is
      suspended, it may take too much time to restore power to the
      domain in response to the request from one of the device's
      children.  In that case, if the parent's resume time is critical,
      the domain should stay in the "power on" state, although it still may
      be desirable to power manage the parent itself (e.g. by manipulating
      its clock).
      
      In general, device PM QoS may be used to address this problem.
      Namely, if the device's children added PM QoS latency constraints
      for it, they would be able to prevent it from being put into an
      overly deep low-power state.  However, in some cases the devices
      needing to be serviced are not the immediate children of a
      "children-ignoring" device, but its grandchildren or even less
      direct descendants.  In those cases, the entity wanting to add a
      PM QoS request for a given device's ancestor that ignores its
      children will have to find it in the first place, so introduce a new
      helper function that may be used to achieve that.  This function,
      dev_pm_qos_add_ancestor_request(), will search for the first
      ancestor of the given device whose power.ignore_children flag is
      set and will add a device PM QoS latency request for that ancestor
      on behalf of the caller.  The request added this way may be removed
      with the help of dev_pm_qos_remove_request() in the future, like
      any other device PM QoS latency request.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      40a5f8be
  12. 02 12月, 2011 1 次提交
    • R
      PM / Runtime: Use device PM QoS constraints (v2) · 00dc9ad1
      Rafael J. Wysocki 提交于
      Make the runtime PM core use device PM QoS constraints to check if
      it is allowed to suspend a given device, so that an error code is
      returned if the device's own PM QoS constraint is negative or one of
      its children has already been suspended for too long.  If this is
      not the case, the maximum estimated time the device is allowed to be
      suspended, computed as the minimum of the device's PM QoS constraint
      and the PM QoS constraints of its children (reduced by the difference
      between the current time and their suspend times) is stored in a new
      device's PM field power.max_time_suspended_ns that can be used by
      the device's subsystem or PM domain to decide whether or not to put
      the device into lower-power (and presumably higher-latency) states
      later (if the constraint is 0, which means "no constraint", the
      power.max_time_suspended_ns is set to -1).
      
      Additionally, the time of execution of the subsystem-level
      .runtime_suspend() callback for the device is recorded in the new
      power.suspend_time field for later use by the device's subsystem or
      PM domain along with power.max_time_suspended_ns (it also is used
      by the core code when the device's parent is suspended).
      
      Introduce a new helper function,
      pm_runtime_update_max_time_suspended(), allowing subsystems and PM
      domains (or device drivers) to update the power.max_time_suspended_ns
      field, for example after changing the power state of a suspended
      device.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      00dc9ad1
  13. 10 11月, 2011 1 次提交
  14. 01 11月, 2011 1 次提交
  15. 05 10月, 2011 1 次提交
    • R
      PM / QoS: Add function dev_pm_qos_read_value() (v3) · 1a9a9152
      Rafael J. Wysocki 提交于
      To read the current PM QoS value for a given device we need to
      make sure that the device's power.constraints object won't be
      removed while we're doing that.  For this reason, put the
      operation under dev->power.lock and acquire the lock
      around the initialization and removal of power.constraints.
      
      Moreover, since we're using the value of power.constraints to
      determine whether or not the object is present, the
      power.constraints_state field isn't necessary any more and may be
      removed.  However, dev_pm_qos_add_request() needs to check if the
      device is being removed from the system before allocating a new
      PM QoS constraints object for it, so make it use the
      power.power_state field of struct device for this purpose.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1a9a9152
  16. 25 8月, 2011 2 次提交
    • J
      PM QoS: Add global notification mechanism for device constraints · b66213cd
      Jean Pihet 提交于
      Add a global notification chain that gets called upon changes to the
      aggregated constraint value for any device.
      The notification callbacks are passing the full constraint request data
      in order for the callees to have access to it. The current use is for the
      platform low-level code to access the target device of the constraint.
      Signed-off-by: NJean Pihet <j-pihet@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      b66213cd
    • J
      PM QoS: Implement per-device PM QoS constraints · 91ff4cb8
      Jean Pihet 提交于
      Implement the per-device PM QoS constraints by creating a device
      PM QoS API, which calls the PM QoS constraints management core code.
      
      The per-device latency constraints data strctures are stored
      in the device dev_pm_info struct.
      
      The device PM code calls the init and destroy of the per-device constraints
      data struct in order to support the dynamic insertion and removal of the
      devices in the system.
      
      To minimize the data usage by the per-device constraints, the data struct
      is only allocated at the first call to dev_pm_qos_add_request.
      The data is later free'd when the device is removed from the system.
      A global mutex protects the constraints users from the data being
      allocated and free'd.
      Signed-off-by: NJean Pihet <j-pihet@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      91ff4cb8