[PATCH] fan: cur_state == -1 is valid for intel_powerclamp

Alex Hung alex.hung at canonical.com
Fri Apr 13 18:18:22 UTC 2018


In Documentation/thermal/intel_powerclamp.txt, it states that the
"When idle injection is disabled, reading cur_state returns value -1
instead of 0 which is to avoid confusing 100% busy state with the
disabled state".

Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/acpi/fan/fan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/acpi/fan/fan.c b/src/acpi/fan/fan.c
index f6e9399..298d3a1 100644
--- a/src/acpi/fan/fan.c
+++ b/src/acpi/fan/fan.c
@@ -154,7 +154,7 @@ static int fan_test1(fwts_framework *fw)
 			fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoFanMaxState",
 				"Fan %s present but has no max_state present.",
 				info->name);
-		if (info->cur_state == -1)
+		if (info->cur_state == -1 && strcmp(info->type, "intel_powerclamp"))
 			fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoFanCurState",
 				"Fan %s present but has no cur_state present.",
 				info->name);
-- 
2.7.4




More information about the fwts-devel mailing list