From a62d97b697f34f3c545b1597189c17e570f12a8b Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Sun, 25 May 2014 16:53:26 +0200 Subject: [PATCH] drm/nouveau/therm/fan: add debug information in fan_update() --- drivers/gpu/drm/nouveau/core/subdev/therm/fan.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c b/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c index 016990a..0e7fe22 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c @@ -55,6 +55,8 @@ nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target) /* check that we're not already at the target duty cycle */ duty = fan->get(therm); if (duty == target) { + nv_debug(therm, "FAN duty reached target %d, stop updating\n", + target); spin_unlock_irqrestore(&fan->lock, flags); return 0; } @@ -76,6 +78,7 @@ nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target) nv_debug(therm, "FAN update: %d\n", duty); ret = fan->set(therm, duty); if (ret) { + nv_debug(therm, "FAN set failed: %d\n", ret); spin_unlock_irqrestore(&fan->lock, flags); return ret; } @@ -98,8 +101,13 @@ nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target) else delay = bump_period; + nv_debug(therm, "FAN schedule next update in %llu\n", delay); + ptimer->alarm(ptimer, delay * 1000 * 1000, &fan->alarm); - } + } else if (!list_empty(&fan->alarm.head)) + nv_debug(therm, "FAN update is already scheduled"); + else if (target == duty) + nv_debug(therm, "FAN update not scheduled, target == duty"); return ret; } -- 1.9.3