diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 12e3a2979..c37f45ddb 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -1376,6 +1376,9 @@ static int nvgpu_gpu_get_temperature(struct gk20a *g, if (args->reserved[0] || args->reserved[1] || args->reserved[2]) return -EINVAL; + if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_GET_TEMPERATURE)) + return -EINVAL; + if (!g->ops.therm.get_internal_sensor_curr_temp) return -EINVAL; diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 1091cbd2b..cf7511351 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -246,6 +246,7 @@ int gv100_init_gpu_characteristics(struct gk20a *g) return err; __nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true); + __nvgpu_set_enabled(g, NVGPU_SUPPORT_GET_TEMPERATURE, true); return 0; } @@ -587,6 +588,14 @@ static const struct gpu_ops gv100_ops = { .exit = gk20a_pramin_exit, .data032_r = pram_data032_r, }, + .therm = { +#ifdef CONFIG_DEBUG_FS + .therm_debugfs_init = gp106_therm_debugfs_init, +#endif /* CONFIG_DEBUG_FS */ + .elcg_init_idle_filters = gp106_elcg_init_idle_filters, + .get_internal_sensor_curr_temp = + gp106_get_internal_sensor_curr_temp, + }, .pmu = { .init_wpr_region = gv100_pmu_init_acr, .load_lsfalcon_ucode = gv100_load_falcon_ucode,