diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 23fbdce0c..6768dbeb1 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c @@ -1278,9 +1278,7 @@ static int nvgpu_gpu_get_temperature(struct gk20a *g, gk20a_idle(g->dev); - /* Convert from standard S24.8 fixed point to mC */ - if (!err) - args->temperature = (temp_f24_8 * 1000) / 256; + args->temp_f24_8 = (s32)temp_f24_8; return err; } diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 16aa51b2b..0aeea4f07 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -743,7 +743,10 @@ struct nvgpu_gpu_get_power_args { struct nvgpu_gpu_get_temperature_args { __u32 reserved[3]; - __u32 temperature; /* mC */ + /* Temperature in signed fixed point format SFXP24.8 + * Celsius = temp_f24_8 / 256. + */ + __s32 temp_f24_8; }; #define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \