• Caesar Wang's avatar
    thermal: rockchip: fixes the exception interrupts · 1f09ba82
    Caesar Wang authored
    The hardware-tracked trips will set the alarm interrupt value for
    registers. Then when the thermal zone has no trips to be set,
    That make the thermal trips callback a over range value.
    
    The root cause is the rk_tsadcv2_temp_to_code() function to handle the
    invalid temperature range is indeed incorrect, let's fix it on now.
    Otherwise, the thermal alarm interrupt will be triggered all the time
    on some SoCs.
    
    Fox example:
    localhost tmp # grep thermal /proc/interrupts; sleep 5;
    grep thermal /proc/interrupts
    
    23:     994830  ..    GICv3 129 Level     rockchip_thermal
    23:    1003423  ..    GICv3 129 Level     rockchip_thermal
    Reported-by: default avatarRocky Hao <rocky.hao@rock-chips.com>
    Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
    Cc: Zhang Rui <rui.zhang@intel.com>
    Cc: Eduardo Valentin <edubezval@gmail.com>
    Cc: Heiko Stuebner <heiko@sntech.de>
    Cc: linux-pm@vger.kernel.org
    Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    1f09ba82
rockchip_thermal.c 32.4 KB