You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
soc: rockchip: system_monitor: add function to remove/restore cpu limit
Signed-off-by: Liang Chen <cl@rock-chips.com> Change-Id: I60c7b3cb1ab68c06852871cf9fa435031915c328
This commit is contained in:
@@ -1131,6 +1131,44 @@ int rockchip_monitor_suspend_low_temp_adjust(int cpu)
|
||||
}
|
||||
EXPORT_SYMBOL(rockchip_monitor_suspend_low_temp_adjust);
|
||||
|
||||
void rockchip_monitor_remove_cpu_limit(int cpu)
|
||||
{
|
||||
struct monitor_dev_info *info;
|
||||
|
||||
down_read(&mdev_list_sem);
|
||||
list_for_each_entry(info, &monitor_dev_list, node) {
|
||||
if (info->devp->type != MONITOR_TYPE_CPU)
|
||||
continue;
|
||||
if (cpumask_test_cpu(cpu, &info->devp->allowed_cpus)) {
|
||||
if (info->status_max_limit)
|
||||
freq_qos_update_request(&info->max_sta_freq_req,
|
||||
FREQ_QOS_MAX_DEFAULT_VALUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
up_read(&mdev_list_sem);
|
||||
}
|
||||
EXPORT_SYMBOL(rockchip_monitor_remove_cpu_limit);
|
||||
|
||||
void rockchip_monitor_restore_cpu_limit(int cpu)
|
||||
{
|
||||
struct monitor_dev_info *info;
|
||||
|
||||
down_read(&mdev_list_sem);
|
||||
list_for_each_entry(info, &monitor_dev_list, node) {
|
||||
if (info->devp->type != MONITOR_TYPE_CPU)
|
||||
continue;
|
||||
if (cpumask_test_cpu(cpu, &info->devp->allowed_cpus)) {
|
||||
if (info->status_max_limit)
|
||||
freq_qos_update_request(&info->max_sta_freq_req,
|
||||
info->status_max_limit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
up_read(&mdev_list_sem);
|
||||
}
|
||||
EXPORT_SYMBOL(rockchip_monitor_restore_cpu_limit);
|
||||
|
||||
static int
|
||||
rockchip_system_monitor_wide_temp_adjust(struct monitor_dev_info *info,
|
||||
int temp)
|
||||
|
||||
@@ -151,6 +151,8 @@ int rockchip_monitor_dev_low_temp_adjust(struct monitor_dev_info *info,
|
||||
int rockchip_monitor_dev_high_temp_adjust(struct monitor_dev_info *info,
|
||||
bool is_high);
|
||||
int rockchip_monitor_suspend_low_temp_adjust(int cpu);
|
||||
void rockchip_monitor_remove_cpu_limit(int cpu);
|
||||
void rockchip_monitor_restore_cpu_limit(int cpu);
|
||||
int rockchip_system_monitor_register_notifier(struct notifier_block *nb);
|
||||
void rockchip_system_monitor_unregister_notifier(struct notifier_block *nb);
|
||||
#else
|
||||
@@ -203,6 +205,14 @@ static inline int rockchip_monitor_suspend_low_temp_adjust(int cpu)
|
||||
return 0;
|
||||
};
|
||||
|
||||
static inline void rockchip_monitor_remove_cpu_limit(int cpu)
|
||||
{
|
||||
};
|
||||
|
||||
static inline void rockchip_monitor_restore_cpu_limit(int cpu)
|
||||
{
|
||||
};
|
||||
|
||||
static inline int
|
||||
rockchip_system_monitor_register_notifier(struct notifier_block *nb)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user