• 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
qos.c 12.1 KB