[v4,26/37] therm: don't cancel the timer

Submitted by Karol Herbst on April 18, 2016, 7:14 p.m.

Details

Message ID 1461006851-5007-27-git-send-email-nouveau@karolherbst.de
State New
Headers show
Series "Volting/Clocking improvements for Fermi and newer" ( rev: 4 ) in Nouveau

Not browsing as part of any series.

Commit Message

Karol Herbst April 18, 2016, 7:14 p.m.
we will need a always running therm daemon to adjust the voltage/clocks on the
fly.

Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
---
 drm/nouveau/nvkm/subdev/therm/base.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/nvkm/subdev/therm/base.c b/drm/nouveau/nvkm/subdev/therm/base.c
index 8894fee..0c0feec 100644
--- a/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drm/nouveau/nvkm/subdev/therm/base.c
@@ -92,7 +92,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);
@@ -102,11 +101,9 @@  nvkm_therm_update(struct nvkm_therm *therm, int mode)
 
 	switch (mode) {
 	case NVKM_THERM_CTRL_MANUAL:
-		nvkm_timer_alarm_cancel(tmr, &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) {
@@ -119,18 +116,16 @@  nvkm_therm_update(struct nvkm_therm *therm, int mode)
 		case NVBIOS_THERM_FAN_OTHER:
 			if (therm->cstate)
 				duty = therm->cstate;
-			poll = false;
 			break;
 		}
 		immd = false;
 		break;
 	case NVKM_THERM_CTRL_NONE:
 	default:
-		nvkm_timer_alarm_cancel(tmr, &therm->alarm);
-		poll = false;
+		break;
 	}
 
-	if (list_empty(&therm->alarm.head) && poll)
+	if (list_empty(&therm->alarm.head))
 		nvkm_timer_alarm(tmr, 1000000000ULL, &therm->alarm);
 	spin_unlock_irqrestore(&therm->lock, flags);
 

Comments

On 18/04/16 22:14, Karol Herbst wrote:
> we will need a always running therm daemon to adjust the voltage/clocks on the
> fly.
>
> Signed-off-by: Karol Herbst <nouveau@karolherbst.de>

Reviewed-by: Martin Peres <martin.peres@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 8894fee..0c0feec 100644
> --- a/drm/nouveau/nvkm/subdev/therm/base.c
> +++ b/drm/nouveau/nvkm/subdev/therm/base.c
> @@ -92,7 +92,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);
> @@ -102,11 +101,9 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
>   
>   	switch (mode) {
>   	case NVKM_THERM_CTRL_MANUAL:
> -		nvkm_timer_alarm_cancel(tmr, &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) {
> @@ -119,18 +116,16 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
>   		case NVBIOS_THERM_FAN_OTHER:
>   			if (therm->cstate)
>   				duty = therm->cstate;
> -			poll = false;
>   			break;
>   		}
>   		immd = false;
>   		break;
>   	case NVKM_THERM_CTRL_NONE:
>   	default:
> -		nvkm_timer_alarm_cancel(tmr, &therm->alarm);
> -		poll = false;
> +		break;
>   	}
>   
> -	if (list_empty(&therm->alarm.head) && poll)
> +	if (list_empty(&therm->alarm.head))
>   		nvkm_timer_alarm(tmr, 1000000000ULL, &therm->alarm);
>   	spin_unlock_irqrestore(&therm->lock, flags);
>