[PATCH v2 0/2] Add fine-grain temperature reporting

From: Jeremy Cline
Date: Wed Sep 16 2020 - 15:49:58 EST


Hi folks,

This series adjusts the temp_get() interface in the thermal functions to
report milli-degrees, and additionally alters the way errors are
reported. As I went through all the users and implementations I realized
that Pascal's temp_get() implementation didn't include turning negative
temperatures to 0 like other implementations, so I separated error
reporting from the temperature in the API.

Couple of things I'm on the fence about here:

* I allowed the nvkm_therm_temp_get() functions to accept NULL as a way
to check if temperature reading is available rather than adding a
separate helper, but was torn about whether this is clearer than a
separate helper function.

* I added a WARN_ON in places that previously called
nvkm_therm_temp_get() and didn't check the return value for an error.
This may not be a reasonable error handling method.

Jeremy Cline (2):
drm/nouveau: return temperatures in temp_get() via parameter
drm/nouveau: Add fine-grain temperature reporting

.../nouveau/include/nvkm/subdev/bios/therm.h | 13 +++++++++
.../drm/nouveau/include/nvkm/subdev/therm.h | 28 ++++++++++++++++++-
drivers/gpu/drm/nouveau/nouveau_hwmon.c | 12 ++++----
.../gpu/drm/nouveau/nvkm/subdev/therm/base.c | 28 +++++++++++++++----
.../gpu/drm/nouveau/nvkm/subdev/therm/g84.c | 11 ++++----
.../gpu/drm/nouveau/nvkm/subdev/therm/gp100.c | 11 ++++----
.../gpu/drm/nouveau/nvkm/subdev/therm/nv40.c | 9 ++----
.../gpu/drm/nouveau/nvkm/subdev/therm/nv50.c | 9 ++----
.../gpu/drm/nouveau/nvkm/subdev/therm/priv.h | 17 +++++++++--
.../gpu/drm/nouveau/nvkm/subdev/therm/temp.c | 12 +++++---
10 files changed, 110 insertions(+), 40 deletions(-)

--
2.26.2