drm/nv40/therm: fix slowing down fan when pstate undefined
authorBen Skeggs <bskeggs@redhat.com>
Wed, 13 Nov 2013 05:52:03 +0000 (15:52 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 14 Nov 2013 04:57:01 +0000 (14:57 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/therm/base.c

index 21b2b3021fadf0f49f1e0b8775acb6ffb264561a..80e584a1bd1cf4e4d6a32a8e3cbfd79739acd1e3 100644 (file)
@@ -117,7 +117,8 @@ nouveau_therm_update(struct nouveau_therm *therm, int mode)
                    priv->fan->bios.linear_max_temp) {
                        duty = nouveau_therm_update_linear(therm);
                } else {
-                       duty = priv->cstate;
+                       if (priv->cstate)
+                               duty = priv->cstate;
                        poll = false;
                }
                immd = false;