• Eduardo Valentin's avatar
    thermal: step_wise: return instance->target by default · ca56caa0
    Eduardo Valentin authored
    In case the trend is not changing or when there is no
    request for throttling, it is expected that the instance
    would not change its requested target. This patch improves
    the code implementation to cover for this expected behavior.
    
    With current implementation, the instance will always
    reset to cdev.cur_state, even in not expected cases,
    like those mentioned above.
    
    This patch changes the step_wise governor implementation
    of get_target so that we accomplish:
    (a) - default value will be current instance->target, so
    we do not change the thermal instance target unnecessarily.
    (b) - the code now it is clear about what is the intention.
    There is a clear statement of what are the expected outcomes
    (c) - removal of hardcoded constants, now it is put in use
    the THERMAL_NO_TARGET macro.
    (d) - variable names are also improved so that reader can
    clearly understand the difference between instance cur target,
    next target and cdev cur_state.
    
    Cc: Zhang Rui <rui.zhang@intel.com>
    Cc: Durgadoss R <durgadoss.r@intel.com>
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Reported-by: default avatarRuslan Ruslichenko <ruslan.ruslichenko@ti.com>
    Signed-of-by: default avatarEduardo Valentin <eduardo.valentin@ti.com>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    ca56caa0
step_wise.c 5.97 KB