From 3fcfa6749a3c022f42fb325ef6c92bc4fa53b350 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Sat, 25 May 2024 11:05:12 +0800 Subject: [PATCH] soc: rockchip: system_monitor: Fix max frequency when use high_limit_table Signed-off-by: Finley Xiao Change-Id: Ie45f3c704b89867274f929dad5c6fcfbd56c2052 --- .../soc/rockchip/rockchip_system_monitor.c | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/soc/rockchip/rockchip_system_monitor.c b/drivers/soc/rockchip/rockchip_system_monitor.c index c1dadec4a4b3..571a131e37fe 100644 --- a/drivers/soc/rockchip/rockchip_system_monitor.c +++ b/drivers/soc/rockchip/rockchip_system_monitor.c @@ -900,18 +900,22 @@ EXPORT_SYMBOL(rockchip_monitor_cpu_low_temp_adjust); int rockchip_monitor_cpu_high_temp_adjust(struct monitor_dev_info *info, bool is_high) { - if (!info->high_limit) - return 0; - if (!freq_qos_request_active(&info->max_temp_freq_req)) return 0; if (info->high_limit_table) { - freq_qos_update_request(&info->max_temp_freq_req, - info->high_limit / 1000); + if (info->high_limit) + freq_qos_update_request(&info->max_temp_freq_req, + info->high_limit / 1000); + else + freq_qos_update_request(&info->max_temp_freq_req, + FREQ_QOS_MAX_DEFAULT_VALUE); return 0; } + if (!info->high_limit) + return 0; + if (is_high) freq_qos_update_request(&info->max_temp_freq_req, info->high_limit / 1000); @@ -949,15 +953,19 @@ int rockchip_monitor_dev_high_temp_adjust(struct monitor_dev_info *info, if (!dev_pm_qos_request_active(&info->dev_max_freq_req)) return 0; - if (!info->high_limit) - return 0; - if (info->high_limit_table) { - dev_pm_qos_update_request(&info->dev_max_freq_req, - info->high_limit / 1000); + if (info->high_limit) + dev_pm_qos_update_request(&info->dev_max_freq_req, + info->high_limit / 1000); + else + dev_pm_qos_update_request(&info->dev_max_freq_req, + PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE); return 0; } + if (!info->high_limit) + return 0; + if (is_high) dev_pm_qos_update_request(&info->dev_max_freq_req, info->high_limit / 1000);