Loading arch/arm64/boot/dts/qcom/sdm845-pm.dtsi +19 −75 Original line number Diff line number Diff line Loading @@ -34,51 +34,15 @@ qcom,time-overhead = <99>; }; qcom,pm-cluster-level@1 { /* D2 */ qcom,pm-cluster-level@1 { /* LLCC off, AOSS sleep */ reg = <1>; label = "l3-dyn-ret"; qcom,psci-mode = <0x2>; qcom,latency-us = <659>; qcom,ss-power = <434>; qcom,energy-overhead = <465725>; qcom,time-overhead = <976>; qcom,min-child-idx = <1>; }; qcom,pm-cluster-level@2 { /* D4, D3 is not supported */ reg = <2>; label = "l3-pc"; qcom,psci-mode = <0x4>; qcom,latency-us = <3201>; qcom,ss-power = <408>; qcom,energy-overhead = <2421840>; qcom,time-overhead = <5376>; qcom,min-child-idx = <2>; qcom,is-reset; }; qcom,pm-cluster-level@3 { /* Cx off */ reg = <3>; label = "cx-off"; qcom,psci-mode = <0x224>; qcom,latency-us = <5562>; qcom,ss-power = <308>; qcom,energy-overhead = <2521840>; qcom,time-overhead = <6376>; qcom,min-child-idx = <3>; qcom,is-reset; qcom,notify-rpm; }; qcom,pm-cluster-level@4 { /* LLCC off, AOSS sleep */ reg = <4>; label = "llcc-off"; qcom,psci-mode = <0xC24>; qcom,latency-us = <6562>; qcom,ss-power = <108>; qcom,energy-overhead = <2621840>; qcom,time-overhead = <7376>; qcom,min-child-idx = <3>; qcom,energy-overhead = <4000000>; qcom,time-overhead = <5000>; qcom,min-child-idx = <2>; qcom,is-reset; qcom,notify-rpm; }; Loading @@ -95,41 +59,31 @@ label = "wfi"; qcom,psci-cpu-mode = <0x1>; qcom,latency-us = <43>; qcom,ss-power = <454>; qcom,energy-overhead = <38639>; qcom,time-overhead = <83>; qcom,ss-power = <150>; qcom,energy-overhead = <10000>; qcom,time-overhead = <100>; }; qcom,pm-cpu-level@1 { /* C2D */ qcom,pm-cpu-level@1 { /* C3 */ reg = <1>; label = "ret"; qcom,psci-cpu-mode = <0x2>; qcom,latency-us = <119>; qcom,ss-power = <449>; qcom,energy-overhead = <78456>; qcom,time-overhead = <167>; }; qcom,pm-cpu-level@2 { /* C3 */ reg = <2>; label = "pc"; qcom,psci-cpu-mode = <0x3>; qcom,latency-us = <461>; qcom,ss-power = <436>; qcom,energy-overhead = <418225>; qcom,time-overhead = <885>; qcom,ss-power = <100>; qcom,energy-overhead = <400000>; qcom,time-overhead = <500>; qcom,is-reset; qcom,use-broadcast-timer; }; qcom,pm-cpu-level@3 { /* C4 */ reg = <3>; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; label = "rail-pc"; qcom,psci-cpu-mode = <0x4>; qcom,latency-us = <531>; qcom,ss-power = <400>; qcom,energy-overhead = <428225>; qcom,time-overhead = <1000>; qcom,ss-power = <73>; qcom,energy-overhead = <500000>; qcom,time-overhead = <600>; qcom,is-reset; qcom,use-broadcast-timer; }; Loading @@ -152,18 +106,8 @@ qcom,time-overhead = <83>; }; qcom,pm-cpu-level@1 { /* C2D */ qcom,pm-cpu-level@1 { /* C3 */ reg = <1>; label = "ret"; qcom,psci-cpu-mode = <0x2>; qcom,latency-us = <116>; qcom,ss-power = <449>; qcom,energy-overhead = <78456>; qcom,time-overhead = <167>; }; qcom,pm-cpu-level@2 { /* C3 */ reg = <2>; label = "pc"; qcom,psci-cpu-mode = <0x3>; qcom,latency-us = <621>; Loading @@ -174,8 +118,8 @@ qcom,use-broadcast-timer; }; qcom,pm-cpu-level@3 { /* C4 */ reg = <3>; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; label = "rail-pc"; qcom,psci-cpu-mode = <0x4>; qcom,latency-us = <1061>; Loading drivers/cpuidle/lpm-levels-of.c +3 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,9 @@ bool lpm_cpu_mode_allow(unsigned int cpu, { struct lpm_level_avail *avail = cpu_level_available[cpu]; if (lpm_pdev && !index) return 1; if (!lpm_pdev || !avail) return !from_idle; Loading drivers/cpuidle/lpm-levels.c +13 −3 Original line number Diff line number Diff line Loading @@ -84,12 +84,13 @@ struct lpm_cluster *lpm_root_node; static bool lpm_prediction = true; module_param_named(lpm_prediction, lpm_prediction, bool, 0664); static uint32_t ref_stddev = 100; static uint32_t ref_stddev = 500; module_param_named(ref_stddev, ref_stddev, uint, 0664); static uint32_t tmr_add = 100; static uint32_t tmr_add = 1000; module_param_named(tmr_add, tmr_add, uint, 0664); static uint32_t ref_premature_cnt = 1; static uint32_t bias_hyst; module_param_named(bias_hyst, bias_hyst, uint, 0664); Loading Loading @@ -436,6 +437,7 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev, int64_t thresh = LLONG_MAX; struct lpm_history *history = &per_cpu(hist, dev->cpu); uint32_t *min_residency = get_per_cpu_min_residency(dev->cpu); uint32_t *max_residency = get_per_cpu_max_residency(dev->cpu); if (!lpm_prediction) return 0; Loading Loading @@ -522,9 +524,17 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev, total += history->resi[i]; } } if (failed > (MAXSAMPLES/2)) { if (failed >= ref_premature_cnt) { *idx_restrict = j; do_div(total, failed); for (i = 0; i < j; i++) { if (total < max_residency[i]) { *idx_restrict = i+1; total = max_residency[i]; break; } } *idx_restrict_time = total; history->stime = ktime_to_us(ktime_get()) + *idx_restrict_time; Loading Loading
arch/arm64/boot/dts/qcom/sdm845-pm.dtsi +19 −75 Original line number Diff line number Diff line Loading @@ -34,51 +34,15 @@ qcom,time-overhead = <99>; }; qcom,pm-cluster-level@1 { /* D2 */ qcom,pm-cluster-level@1 { /* LLCC off, AOSS sleep */ reg = <1>; label = "l3-dyn-ret"; qcom,psci-mode = <0x2>; qcom,latency-us = <659>; qcom,ss-power = <434>; qcom,energy-overhead = <465725>; qcom,time-overhead = <976>; qcom,min-child-idx = <1>; }; qcom,pm-cluster-level@2 { /* D4, D3 is not supported */ reg = <2>; label = "l3-pc"; qcom,psci-mode = <0x4>; qcom,latency-us = <3201>; qcom,ss-power = <408>; qcom,energy-overhead = <2421840>; qcom,time-overhead = <5376>; qcom,min-child-idx = <2>; qcom,is-reset; }; qcom,pm-cluster-level@3 { /* Cx off */ reg = <3>; label = "cx-off"; qcom,psci-mode = <0x224>; qcom,latency-us = <5562>; qcom,ss-power = <308>; qcom,energy-overhead = <2521840>; qcom,time-overhead = <6376>; qcom,min-child-idx = <3>; qcom,is-reset; qcom,notify-rpm; }; qcom,pm-cluster-level@4 { /* LLCC off, AOSS sleep */ reg = <4>; label = "llcc-off"; qcom,psci-mode = <0xC24>; qcom,latency-us = <6562>; qcom,ss-power = <108>; qcom,energy-overhead = <2621840>; qcom,time-overhead = <7376>; qcom,min-child-idx = <3>; qcom,energy-overhead = <4000000>; qcom,time-overhead = <5000>; qcom,min-child-idx = <2>; qcom,is-reset; qcom,notify-rpm; }; Loading @@ -95,41 +59,31 @@ label = "wfi"; qcom,psci-cpu-mode = <0x1>; qcom,latency-us = <43>; qcom,ss-power = <454>; qcom,energy-overhead = <38639>; qcom,time-overhead = <83>; qcom,ss-power = <150>; qcom,energy-overhead = <10000>; qcom,time-overhead = <100>; }; qcom,pm-cpu-level@1 { /* C2D */ qcom,pm-cpu-level@1 { /* C3 */ reg = <1>; label = "ret"; qcom,psci-cpu-mode = <0x2>; qcom,latency-us = <119>; qcom,ss-power = <449>; qcom,energy-overhead = <78456>; qcom,time-overhead = <167>; }; qcom,pm-cpu-level@2 { /* C3 */ reg = <2>; label = "pc"; qcom,psci-cpu-mode = <0x3>; qcom,latency-us = <461>; qcom,ss-power = <436>; qcom,energy-overhead = <418225>; qcom,time-overhead = <885>; qcom,ss-power = <100>; qcom,energy-overhead = <400000>; qcom,time-overhead = <500>; qcom,is-reset; qcom,use-broadcast-timer; }; qcom,pm-cpu-level@3 { /* C4 */ reg = <3>; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; label = "rail-pc"; qcom,psci-cpu-mode = <0x4>; qcom,latency-us = <531>; qcom,ss-power = <400>; qcom,energy-overhead = <428225>; qcom,time-overhead = <1000>; qcom,ss-power = <73>; qcom,energy-overhead = <500000>; qcom,time-overhead = <600>; qcom,is-reset; qcom,use-broadcast-timer; }; Loading @@ -152,18 +106,8 @@ qcom,time-overhead = <83>; }; qcom,pm-cpu-level@1 { /* C2D */ qcom,pm-cpu-level@1 { /* C3 */ reg = <1>; label = "ret"; qcom,psci-cpu-mode = <0x2>; qcom,latency-us = <116>; qcom,ss-power = <449>; qcom,energy-overhead = <78456>; qcom,time-overhead = <167>; }; qcom,pm-cpu-level@2 { /* C3 */ reg = <2>; label = "pc"; qcom,psci-cpu-mode = <0x3>; qcom,latency-us = <621>; Loading @@ -174,8 +118,8 @@ qcom,use-broadcast-timer; }; qcom,pm-cpu-level@3 { /* C4 */ reg = <3>; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; label = "rail-pc"; qcom,psci-cpu-mode = <0x4>; qcom,latency-us = <1061>; Loading
drivers/cpuidle/lpm-levels-of.c +3 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,9 @@ bool lpm_cpu_mode_allow(unsigned int cpu, { struct lpm_level_avail *avail = cpu_level_available[cpu]; if (lpm_pdev && !index) return 1; if (!lpm_pdev || !avail) return !from_idle; Loading
drivers/cpuidle/lpm-levels.c +13 −3 Original line number Diff line number Diff line Loading @@ -84,12 +84,13 @@ struct lpm_cluster *lpm_root_node; static bool lpm_prediction = true; module_param_named(lpm_prediction, lpm_prediction, bool, 0664); static uint32_t ref_stddev = 100; static uint32_t ref_stddev = 500; module_param_named(ref_stddev, ref_stddev, uint, 0664); static uint32_t tmr_add = 100; static uint32_t tmr_add = 1000; module_param_named(tmr_add, tmr_add, uint, 0664); static uint32_t ref_premature_cnt = 1; static uint32_t bias_hyst; module_param_named(bias_hyst, bias_hyst, uint, 0664); Loading Loading @@ -436,6 +437,7 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev, int64_t thresh = LLONG_MAX; struct lpm_history *history = &per_cpu(hist, dev->cpu); uint32_t *min_residency = get_per_cpu_min_residency(dev->cpu); uint32_t *max_residency = get_per_cpu_max_residency(dev->cpu); if (!lpm_prediction) return 0; Loading Loading @@ -522,9 +524,17 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev, total += history->resi[i]; } } if (failed > (MAXSAMPLES/2)) { if (failed >= ref_premature_cnt) { *idx_restrict = j; do_div(total, failed); for (i = 0; i < j; i++) { if (total < max_residency[i]) { *idx_restrict = i+1; total = max_residency[i]; break; } } *idx_restrict_time = total; history->stime = ktime_to_us(ktime_get()) + *idx_restrict_time; Loading