浏览代码

drm/nouveau/therm: disable auto fan management if temperature is not available

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres 12 年之前
父节点
当前提交
98ee7c7c63
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/gpu/drm/nouveau/core/subdev/therm/base.c

+ 5 - 0
drivers/gpu/drm/nouveau/core/subdev/therm/base.c

@@ -149,6 +149,11 @@ nouveau_therm_fan_mode(struct nouveau_therm *therm, int mode)
 	    (mode != NOUVEAU_THERM_CTRL_NONE && device->card_type >= NV_C0))
 		return -EINVAL;
 
+	/* do not allow automatic fan management if the thermal sensor is
+	 * not available */
+	if (priv->mode == 2 && therm->temp_get(therm) < 0)
+		return -EINVAL;
+
 	if (priv->mode == mode)
 		return 0;