thermal: fix thermal issue
authorHuan Biao <huan.biao@amlogic.com>
Fri, 11 May 2018 02:57:31 +0000 (10:57 +0800)
committerHuan Biao <huan.biao@amlogic.com>
Mon, 14 May 2018 09:33:53 +0000 (17:33 +0800)
PD#166068: thermal: fix cpu cooldev work issue and gpupp not match

Change-Id: I26f4626b309cad984e59f3c2f30eb60f1ec5121b
Signed-off-by: Huan Biao <huan.biao@amlogic.com>
arch/arm64/boot/dts/amlogic/mesong12a-dvalin.dtsi
arch/arm64/boot/dts/amlogic/mesong12a.dtsi
drivers/amlogic/thermal/meson_cooldev.c

index faccb7c..d485843 100644 (file)
@@ -21,7 +21,7 @@
                interrupts = <0 160 4>, <0 161 4>, <0 162 4>;
                interrupt-names = "GPU", "MMU", "JOB";
 
-               num_of_pp = <3>;
+               num_of_pp = <2>;
                sc_mpp = <1>; /* number of shader cores used most of time. */
                clocks = <&clkc CLKID_GPU_MUX &clkc CLKID_GP0_PLL>;
                clock-names = "gpu_mux","gp0_pll";
index d16931a..daf8adb 100644 (file)
                        cooling_devices {
                                cpufreq_cool_cluster0 {
                                        min_state = <1000000>;
-                                       dyn_coeff = <140>;
+                                       dyn_coeff = <115>;
                                        cluster_id = <0>;
                                        node_name = "cpufreq_cool0";
                                        device_type = "cpufreq";
                                };
                                gpufreq_cool {
                                        min_state = <400>;
-                                       dyn_coeff = <437>;
+                                       dyn_coeff = <358>;
+                                       gpu_pp = <2>;
                                        cluster_id = <0>;
                                        node_name = "gpufreq_cool0";
                                        device_type = "gpufreq";
                soc_thermal: soc_thermal {
                        polling-delay = <1000>;
                        polling-delay-passive = <100>;
-                       sustainable-power = <2150>;
+                       sustainable-power = <1460>;
                        thermal-sensors = <&p_tsensor 0>;
                        trips {
                                pswitch_on: trip-point@0 {
index 2e3282b..882e8fa 100644 (file)
@@ -45,6 +45,7 @@ enum cool_dev_type {
 struct cool_dev {
        int min_state;
        int coeff;
+       int gpupp;
        int cluster_id;
        char *device_type;
        struct device_node *np;
@@ -264,7 +265,6 @@ static int register_cool_dev(struct platform_device *pdev, int index)
 {
        struct meson_cooldev *mcooldev = platform_get_drvdata(pdev);
        struct cool_dev *cool = &mcooldev->cool_devs[index];
-       int pp;
        struct cpumask *mask;
        int id = cool->cluster_id;
 
@@ -284,9 +284,7 @@ static int register_cool_dev(struct platform_device *pdev, int index)
                break;
        /* GPU is KO, just save these parameters */
        case COOL_DEV_TYPE_GPU_FREQ:
-               if (of_property_read_u32(cool->np, "num_of_pp", &pp))
-                       pr_err("thermal: read num_of_pp failed\n");
-               save_gpu_cool_para(cool->coeff, cool->np, pp);
+               save_gpu_cool_para(cool->coeff, cool->np, cool->gpupp);
                return 0;
 
        case COOL_DEV_TYPE_GPU_CORE:
@@ -342,6 +340,11 @@ static int parse_cool_device(struct platform_device *pdev)
                else
                        cool->coeff = temp;
 
+               if (of_property_read_u32(child, "gpu_pp", &temp))
+                       pr_err("thermal: read gpupp failed\n");
+               else
+                       cool->gpupp = temp;
+
                if (of_property_read_u32(child, "cluster_id", &temp))
                        pr_err("thermal: read cluster_id failed\n");
                else