From: Martin Peres Date: Thu, 14 Mar 2013 23:21:07 +0000 (+0100) Subject: drm/nouveau/therm: disable auto fan management if temperature is not available X-Git-Tag: v3.9-rc4~19^2~3^2~5 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=98ee7c7c63f16e443f51abf08e5412f8eb44ad1e;p=~emulex%2Finfiniband.git drm/nouveau/therm: disable auto fan management if temperature is not available Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c index 3f8083f41be..d6a05589c94 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c +++ b/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;