dorimanx / DORIMANX_LG_STOCK_LP_KERNEL

Kernel for LG G2 LP STOCK/MODDED ROM
http://forum.xda-developers.com/lg-g2/development/lp-5-0-2-kernel-3-4-107-dorimanx-1-0-lg-t3102512
GNU General Public License v2.0
30 stars 17 forks source link

about thermal limit_idx_low #10

Closed shminer closed 8 years ago

shminer commented 9 years ago

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.

dorimanx commented 9 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.

shminer commented 9 years ago

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

so I found https://github.com/dorimanx/DORIMANX_LG_STOCK_LP_KERNEL/blob/master/drivers/thermal/msm_thermal-dev.c#L121

If kernel created /dev/msm_thermal_query,thermal-engine send cmd to this sysfs.And it will contral cpu freq by other way.

shminer commented 9 years ago

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

dorimanx commented 9 years ago

so what you suggest to change? or just block ROM thermal from doing any changes to that control?

shminer commented 9 years ago

I disable cc msm_thermal-dev.o .thermal-engine will not find /dev/msm_thermal_query.

dorimanx commented 8 years ago

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