Blob Blame History Raw
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] Revert "drm/nouveau/drm/therm/fan: add a fallback if no fan control is specified in the vbios"
References: bsc#1103356
Patch-mainline: Never, a temporary workaround

This reverts commit 800efb4c2857ec543fdc33585bbcb1fd5ef28337.
Since it is confirmed to be rather harmful, just revert it until the
problem gets addressed properly in the upstream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 .../gpu/drm/nouveau/nvkm/subdev/therm/base.c  | 22 +++----------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
index 3695cde669f8..699dad03bc5d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
@@ -65,9 +65,10 @@ nvkm_therm_update_trip(struct nvkm_therm *therm)
 }
 
 static int
-nvkm_therm_compute_linear_duty(struct nvkm_therm *therm, u8 linear_min_temp,
-                               u8 linear_max_temp)
+nvkm_therm_update_linear(struct nvkm_therm *therm)
 {
+	u8  linear_min_temp = therm->fan->bios.linear_min_temp;
+	u8  linear_max_temp = therm->fan->bios.linear_max_temp;
 	u8  temp = therm->func->temp_get(therm);
 	u16 duty;
 
@@ -85,21 +86,6 @@ nvkm_therm_compute_linear_duty(struct nvkm_therm *therm, u8 linear_min_temp,
 	return duty;
 }
 
-static int
-nvkm_therm_update_linear(struct nvkm_therm *therm)
-{
-	u8  min = therm->fan->bios.linear_min_temp;
-	u8  max = therm->fan->bios.linear_max_temp;
-	return nvkm_therm_compute_linear_duty(therm, min, max);
-}
-
-static int
-nvkm_therm_update_linear_fallback(struct nvkm_therm *therm)
-{
-	u8 max = therm->bios_sensor.thrs_fan_boost.temp;
-	return nvkm_therm_compute_linear_duty(therm, 30, max);
-}
-
 static void
 nvkm_therm_update(struct nvkm_therm *therm, int mode)
 {
@@ -134,8 +120,6 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode)
 		case NVBIOS_THERM_FAN_OTHER:
 			if (therm->cstate)
 				duty = therm->cstate;
-			else
-				duty = nvkm_therm_update_linear_fallback(therm);
 			poll = false;
 			break;
 		}
-- 
2.18.0