• Stephan Gerhold's avatar
    pmdomain: core: Scale down parent/child performance states in reverse order · 2b391c4c
    Stephan Gerhold authored
    Power domains might have parent domains assigned that are automatically
    managed by the PM domain core. In particular, parent domains are
    automatically powered on/off and setting performance states on child
    domains are propagated to parent domains (e.g. using an OPP table from the
    device tree).
    
    Currently the parent performance state is always adjusted before the
    performance state of the child domain, which is a problem for some cases
    when scaling down the performance state. More exactly, it may lead to that
    the parent domain could run in a lower performance state, than what is
    required by the child domain.
    
    To fix the behaviour, let's differentiate between scaling up/down and
    adjust the order of operations:
    
     - When scaling up, parent domains should be adjusted before the child
       domain. In case of an error, the rollback happens in reverse order.
    
     - When scaling down, parent domains should be adjusted after the child
       domain, in reverse order, just as if we would rollback scaling up.
       In case of an error, the rollback happens in normal order (just as
       if we would normally scale up).
    Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
    Link: https://lore.kernel.org/r/20240103-genpd-perf-order-v2-1-eeecfc55624b@gerhold.netTested-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    2b391c4c
core.c 86.3 KB