]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
arm: tegra13: soctherm: temporary adjust throttle
authorDiwakar Tundlam <dtundlam@nvidia.com>
Fri, 4 Apr 2014 22:28:26 +0000 (15:28 -0700)
committerDiwakar Tundlam <dtundlam@nvidia.com>
Mon, 7 Apr 2014 20:29:09 +0000 (13:29 -0700)
Temporarily adjust thermal throttling parameters for T132 devices to
avoid random shutdown issues seen on some platforms.

Bug 1468124

Change-Id: Id7939110deae7f3076914a8a76049ca98fc843e4
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/392519

arch/arm/mach-tegra/tegra11_soctherm.c

index ee8bfcfea1a84cba99a9e5881a71dfd31f99b13d..d247b8e73b191f0374cb9dd779d852c213f48f79 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/uaccess.h>
 #include <linux/thermal.h>
 #include <linux/platform_data/thermal_sensors.h>
+#include <linux/pid_thermal_gov.h>
 #include <linux/bug.h>
 #include <linux/tegra-fuse.h>
 #include <linux/tegra-pmc.h>
@@ -723,6 +724,17 @@ static int soctherm_ocx_to_wake_gpio[TEGRA_SOC_OC_IRQ_MAX] = {
 static int sensor2therm_a[TSENSE_SIZE];
 static int sensor2therm_b[TSENSE_SIZE];
 
+static struct pid_thermal_gov_params t13_pid_params = {
+       .max_err_temp = 12000,
+       /* other fields are same */
+};
+
+struct soctherm_therm t13_therm = {
+       .passive_delay = 500,
+       .hotspot_offset = 0,
+       /* other fields are same */
+};
+
 /**
  * div64_s64_precise() - wrapper for div64_s64()
  * @a: the dividend
@@ -1624,6 +1636,7 @@ static int __init soctherm_thermal_sys_init(void)
 {
        char name[THERMAL_NAME_LENGTH];
        struct soctherm_therm *therm;
+       struct pid_thermal_gov_params *gov;
        bool oc_en = false;
        int i, j;
 
@@ -1657,6 +1670,13 @@ static int __init soctherm_thermal_sys_init(void)
                        }
                }
 
+               /* XXX: temporarily adjust paramters for T132 */
+               if (IS_T13X) {
+                       gov = therm->tzp->governor_params;
+                       gov->max_err_temp = t13_pid_params.max_err_temp;
+                       therm->passive_delay = t13_therm.passive_delay;
+               }
+
                snprintf(name, THERMAL_NAME_LENGTH, "%s-therm", therm_names[i]);
                soctherm_th_zones[i] = thermal_zone_device_register(
                                                name,
@@ -2822,9 +2842,26 @@ static int soctherm_init_platform_data(void)
                                        i, j, therm->trips[j].trip_temp);
                                therm->trips[j].trip_temp -= rem;
                        }
+
+                       /* XXX: temporarily lower thresholds for T132 */
+                       if (IS_T13X) {
+                               if (therm->trips[j].trip_type ==
+                                                       THERMAL_TRIP_HOT)
+                                       therm->trips[j].trip_temp -= 2000;
+                               else if (therm->trips[j].trip_type ==
+                                                       THERMAL_TRIP_PASSIVE)
+                                       therm->trips[j].trip_temp -= 5000;
+                       }
                }
        }
 
+       /* XXX: temporarily use ZERO hotspot offset for T132 */
+       if (IS_T13X) {
+               plat_data.therm[THERM_CPU].hotspot_offset = 0;
+               plat_data.therm[THERM_GPU].hotspot_offset = 0;
+               plat_data.therm[THERM_MEM].hotspot_offset = 0;
+       }
+
        /* Program hotspot offsets per THERM */
        r = REG_SET(0, TS_HOTSPOT_OFF_CPU,
                    plat_data.therm[THERM_CPU].hotspot_offset / 1000);