From d06966c4d9eefa823dd25b87224c2c4c489630e2 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Mon, 7 Nov 2016 15:54:56 +0530 Subject: gpu: nvgpu: Add thermal alert event handling * Added the thermal alert event handling * Added the thermal alert event PMU RPC JIRA DNVGPU-130 Bug 200231080 Change-Id: I54ab0dc35a940e70733238fd95669db28389619a Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1248968 (cherry picked from commit a20593c89a374d64201e4720552160a65533ecc3) Reviewed-on: http://git-master/r/1282076 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gp106/therm_gp106.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers/gpu/nvgpu/gp106/therm_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/gp106/therm_gp106.c index 7bdf0b9e..bbcc5c80 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.c +++ b/drivers/gpu/nvgpu/gp106/therm_gp106.c @@ -14,6 +14,7 @@ #include "therm_gp106.h" #include #include "hw_therm_gp106.h" +#include "therm/thrmpmu.h" static void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8) { @@ -117,6 +118,18 @@ static int gp106_elcg_init_idle_filters(struct gk20a *g) return 0; } +static u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp) +{ + u32 err = 0; + + if (g->curr_warn_temp != curr_warn_temp) { + g->curr_warn_temp = curr_warn_temp; + err = therm_configure_therm_alert(g); + } + + return err; +} + void gp106_init_therm_ops(struct gpu_ops *gops) { #ifdef CONFIG_DEBUG_FS gops->therm.therm_debugfs_init = gp106_therm_debugfs_init; @@ -125,4 +138,5 @@ void gp106_init_therm_ops(struct gpu_ops *gops) { gops->therm.get_internal_sensor_curr_temp = gp106_get_internal_sensor_curr_temp; gops->therm.get_internal_sensor_limits = gp106_get_internal_sensor_limits; + gops->therm.configure_therm_alert = gp106_configure_therm_alert; } -- cgit v1.2.2