[Nouveau] [RFC PATCH 08/13] therm: Don't cancel the timer

Karol Herbst karolherbst at gmail.com
Fri Jul 21 21:55:19 UTC 2017


We will need a always running therm daemon to adjust the voltage/clocks on
the fly.

Signed-off-by: Karol Herbst <karolherbst at gmail.com>
Reviewed-by: Martin Peres <martin.peres at free.fr>
---
 drm/nouveau/nvkm/subdev/therm/base.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/therm/base.c b/drm/nouveau/nvkm/subdev/therm/base.c
index 952a7cb0..2c9b2730 100644
--- a/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drm/nouveau/nvkm/subdev/therm/base.c
@@ -106,7 +106,6 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
 	struct nvkm_timer *tmr = subdev->device->timer;
 	unsigned long flags;
 	bool immd = true;
-	bool poll = true;
 	int duty = -1;
 
 	spin_lock_irqsave(&therm->lock, flags);
@@ -116,11 +115,9 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
 
 	switch (mode) {
 	case NVKM_THERM_CTRL_MANUAL:
-		nvkm_timer_alarm(tmr, 0, &therm->alarm);
 		duty = nvkm_therm_fan_get(therm);
 		if (duty < 0)
 			duty = 100;
-		poll = false;
 		break;
 	case NVKM_THERM_CTRL_AUTO:
 		switch(therm->fan->bios.fan_mode) {
@@ -135,18 +132,16 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
 				duty = therm->cstate;
 			else
 				duty = nvkm_therm_update_linear_fallback(therm);
-			poll = false;
 			break;
 		}
 		immd = false;
 		break;
 	case NVKM_THERM_CTRL_NONE:
 	default:
-		nvkm_timer_alarm(tmr, 0, &therm->alarm);
-		poll = false;
+		break;
 	}
 
-	if (poll)
+	if (list_empty(&therm->alarm.head))
 		nvkm_timer_alarm(tmr, 1000000000ULL, &therm->alarm);
 	spin_unlock_irqrestore(&therm->lock, flags);
 
-- 
2.13.2



More information about the Nouveau mailing list