Displaying 1 result from an estimated 1 matches for "d445c6f3f".
2019 Jun 18
1
[PATCH] hwmon: return EINVAL if the GPU is powered down for sensors reads
...bogus values userspace gets from hwmon while the GPU is powered down
Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
drm/nouveau/nouveau_hwmon.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drm/nouveau/nouveau_hwmon.c b/drm/nouveau/nouveau_hwmon.c
index 618d8b780..d445c6f3f 100644
--- a/drm/nouveau/nouveau_hwmon.c
+++ b/drm/nouveau/nouveau_hwmon.c
@@ -426,6 +426,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
switch (attr) {
case hwmon_temp_input:
+ if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
+ return -EINVAL;
re...