diff mbox series

fan: cur_state == -1 is valid for intel_powerclamp

Message ID 1523643502-28643-1-git-send-email-alex.hung@canonical.com
State Accepted
Headers show
Series fan: cur_state == -1 is valid for intel_powerclamp | expand

Commit Message

Alex Hung April 13, 2018, 6:18 p.m. UTC
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@canonical.com>
---
 src/acpi/fan/fan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King April 13, 2018, 7:10 p.m. UTC | #1
On 13/04/18 19:18, Alex Hung wrote:
> 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@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);
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu April 25, 2018, 8:54 a.m. UTC | #2
On 04/14/2018 02:18 AM, Alex Hung wrote:
> 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@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);
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

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);