Closed shminer closed 8 years ago
can you provide proof that this actually happen? add printk to functions to see that limited_idx_low is invalid. i didnt noticed any bad behavior from msm thermal. it's works like it should.
when thermal-engine running,I see debug log limited_idx_low is my set,but cpu freq was limited other value,I chmod 0444 /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq,but not work.
And then I see https://github.com/dorimanx/DORIMANX_LG_STOCK_LP_KERNEL/blob/master/drivers/thermal/msm_thermal.c#L1072
msm_thermal_set_frequency will change max freq https://github.com/dorimanx/DORIMANX_LG_STOCK_LP_KERNEL/blob/master/drivers/thermal/msm_thermal.c#L1182
If kernel created /dev/msm_thermal_query,thermal-engine send cmd to this sysfs.And it will contral cpu freq by other way.
Total process is:
thermal-engine send cmd to "/dev/msm_thermal_query"→“msm_thermal_ioctl_process”→“msm_thermal_set_frequency(query.cpu_freq.cpu_num,query.cpu_freq.freq_req, true)”→”msm_thermal_set_frequency“ change “cpus[cpu].user_max_freq” →do_freq_mitigation
so what you suggest to change? or just block ROM thermal from doing any changes to that control?
I disable cc msm_thermal-dev.o .thermal-engine will not find /dev/msm_thermal_query.
for now i dont see a problem that kernel not obey our hard limit when heat is critical.. I want to be in the safe side. so i will not disable msm_thermal-dev.c
https://github.com/dorimanx/DORIMANX_LG_STOCK_LP_KERNEL/blob/master/drivers/thermal/msm_thermal.c#L2106 I think we should disable "msm_thermal_ioctl_init".
when doing msm_thermal_ioctl_process.https://github.com/dorimanx/DORIMANX_LG_STOCK_LP_KERNEL/blob/master/drivers/thermal/msm_thermal-dev.c#L108
Thermal-engine service will contral cpu max freq by /dev/msm_thermal_query
Then doing this case:
case MSM_THERMAL_SET_CPU_MAX_FREQUENCY: ret = msm_thermal_set_frequency(query.cpu_freq.cpu_num, query.cpu_freq.freq_req, true);
when "cpus[cpu].user_max_freq" changed, thread "do_freq_mitigation" will change cpus[cpu].limited_max_freq.
"do_freq_control" will get a different “max_freq” limited_idx_low Invalid.