All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-01 17:28 Prarit Bhargava
  2015-10-01 17:57   ` [Devel] " Moore, Robert
  0 siblings, 1 reply; 29+ messages in thread
From: Prarit Bhargava @ 2015-10-01 17:28 UTC (permalink / raw)
  To: devel
  Cc: Prarit Bhargava, Robert Moore, Lv Zheng, Rafael J. Wysocki,
	Len Brown, linux-acpi

48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
integers") changed the error handling in AcpiGetSleepTypeData such that

ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130517/hwxface-571)

is displayed on systems not implementing individual ACPI \_Sx sleep states.
Since these states are optional the loud warning is incorrect.  This patch
changes the kernel to the older behaviour of not warning on a missing \_Sx.

Before patch:

[root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
 ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130517/hwxface-571)
 ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20130517/hwxface-571)
 ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
[root@dell-pem520-03 ~]#

After patch:

[root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
[root@dell-pem520-03 ~]#

Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2 integers")
Cc: Robert Moore <robert.moore@intel.com>
Cc: Lv Zheng <lv.zheng@intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/acpi/acpica/hwxface.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 5f97468..8f50a7f 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -508,6 +508,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
 	status = acpi_ns_evaluate(info);
 	if (ACPI_FAILURE(status)) {
+		/* \_Sx states are optional */
 		goto cleanup;
 	}
 
@@ -517,7 +518,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
 			    info->relative_pathname));
 		status = AE_AML_NO_RETURN_VALUE;
-		goto cleanup;
+		goto cleanup1;
 	}
 
 	/* Return object must be of type Package */
@@ -526,7 +527,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO,
 			    "Sleep State return object is not a Package"));
 		status = AE_AML_OPERAND_TYPE;
-		goto cleanup1;
+		goto cleanup2;
 	}
 
 	/*
@@ -570,16 +571,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		break;
 	}
 
-cleanup1:
+cleanup2:
 	acpi_ut_remove_reference(info->return_object);
 
-cleanup:
+cleanup1:
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status,
 				"While evaluating Sleep State [%s]",
 				info->relative_pathname));
 	}
 
+cleanup:
 	ACPI_FREE(info);
 	return_ACPI_STATUS(status);
 }
-- 
1.7.9.3


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-01 17:57   ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-01 17:57 UTC (permalink / raw)
  To: Prarit Bhargava, devel
  Cc: Zheng, Lv, Wysocki, Rafael J, Len Brown, linux-acpi, Box, David E

I seem to remember that this came up a long time ago.

Perhaps someone else will remember.


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Thursday, October 01, 2015 10:29 AM
> To: devel@acpica.org
> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> Brown; linux-acpi@vger.kernel.org
> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> not result in a loud warning
> 
> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> integers") changed the error handling in AcpiGetSleepTypeData such that
> 
> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)
> 
> is displayed on systems not implementing individual ACPI \_Sx sleep
> states.
> Since these states are optional the loud warning is incorrect.  This patch
> changes the kernel to the older behaviour of not warning on a missing
> \_Sx.
> 
> Before patch:
> 
> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> [root@dell-pem520-03 ~]#
> 
> After patch:
> 
> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> [root@dell-pem520-03 ~]#
> 
> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> 1 or 2 integers")
> Cc: Robert Moore <robert.moore@intel.com>
> Cc: Lv Zheng <lv.zheng@intel.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-acpi@vger.kernel.org
> 
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> ---
>  drivers/acpi/acpica/hwxface.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> index 5f97468..8f50a7f 100644
> --- a/drivers/acpi/acpica/hwxface.c
> +++ b/drivers/acpi/acpica/hwxface.c
> @@ -508,6 +508,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
>  	status = acpi_ns_evaluate(info);
>  	if (ACPI_FAILURE(status)) {
> +		/* \_Sx states are optional */
>  		goto cleanup;
>  	}
> 
> @@ -517,7 +518,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> [%s]",
>  			    info->relative_pathname));
>  		status = AE_AML_NO_RETURN_VALUE;
> -		goto cleanup;
> +		goto cleanup1;
>  	}
> 
>  	/* Return object must be of type Package */ @@ -526,7 +527,7 @@
> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> *sleep_type_b)
>  		ACPI_ERROR((AE_INFO,
>  			    "Sleep State return object is not a Package"));
>  		status = AE_AML_OPERAND_TYPE;
> -		goto cleanup1;
> +		goto cleanup2;
>  	}
> 
>  	/*
> @@ -570,16 +571,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		break;
>  	}
> 
> -cleanup1:
> +cleanup2:
>  	acpi_ut_remove_reference(info->return_object);
> 
> -cleanup:
> +cleanup1:
>  	if (ACPI_FAILURE(status)) {
>  		ACPI_EXCEPTION((AE_INFO, status,
>  				"While evaluating Sleep State [%s]",
>  				info->relative_pathname));
>  	}
> 
> +cleanup:
>  	ACPI_FREE(info);
>  	return_ACPI_STATUS(status);
>  }
> --
> 1.7.9.3


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-01 17:57   ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-01 17:57 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]

I seem to remember that this came up a long time ago.

Perhaps someone else will remember.


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Thursday, October 01, 2015 10:29 AM
> To: devel(a)acpica.org
> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> Brown; linux-acpi(a)vger.kernel.org
> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> not result in a loud warning
> 
> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> integers") changed the error handling in AcpiGetSleepTypeData such that
> 
> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)
> 
> is displayed on systems not implementing individual ACPI \_Sx sleep
> states.
> Since these states are optional the loud warning is incorrect.  This patch
> changes the kernel to the older behaviour of not warning on a missing
> \_Sx.
> 
> Before patch:
> 
> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> [root(a)dell-pem520-03 ~]#
> 
> After patch:
> 
> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> [root(a)dell-pem520-03 ~]#
> 
> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> 1 or 2 integers")
> Cc: Robert Moore <robert.moore(a)intel.com>
> Cc: Lv Zheng <lv.zheng(a)intel.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
> Cc: Len Brown <lenb(a)kernel.org>
> Cc: linux-acpi(a)vger.kernel.org
> 
> Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
> ---
>  drivers/acpi/acpica/hwxface.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> index 5f97468..8f50a7f 100644
> --- a/drivers/acpi/acpica/hwxface.c
> +++ b/drivers/acpi/acpica/hwxface.c
> @@ -508,6 +508,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
>  	status = acpi_ns_evaluate(info);
>  	if (ACPI_FAILURE(status)) {
> +		/* \_Sx states are optional */
>  		goto cleanup;
>  	}
> 
> @@ -517,7 +518,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> [%s]",
>  			    info->relative_pathname));
>  		status = AE_AML_NO_RETURN_VALUE;
> -		goto cleanup;
> +		goto cleanup1;
>  	}
> 
>  	/* Return object must be of type Package */ @@ -526,7 +527,7 @@
> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> *sleep_type_b)
>  		ACPI_ERROR((AE_INFO,
>  			    "Sleep State return object is not a Package"));
>  		status = AE_AML_OPERAND_TYPE;
> -		goto cleanup1;
> +		goto cleanup2;
>  	}
> 
>  	/*
> @@ -570,16 +571,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		break;
>  	}
> 
> -cleanup1:
> +cleanup2:
>  	acpi_ut_remove_reference(info->return_object);
> 
> -cleanup:
> +cleanup1:
>  	if (ACPI_FAILURE(status)) {
>  		ACPI_EXCEPTION((AE_INFO, status,
>  				"While evaluating Sleep State [%s]",
>  				info->relative_pathname));
>  	}
> 
> +cleanup:
>  	ACPI_FREE(info);
>  	return_ACPI_STATUS(status);
>  }
> --
> 1.7.9.3


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
  2015-10-01 17:57   ` [Devel] " Moore, Robert
  (?)
@ 2015-10-01 22:28   ` Rafael J. Wysocki
  2015-10-07 15:28     ` Prarit Bhargava
  -1 siblings, 1 reply; 29+ messages in thread
From: Rafael J. Wysocki @ 2015-10-01 22:28 UTC (permalink / raw)
  To: Moore, Robert, Prarit Bhargava, devel
  Cc: Zheng, Lv, Len Brown, linux-acpi, Box, David E

On 10/1/2015 7:57 PM, Moore, Robert wrote:
> I seem to remember that this came up a long time ago.
>
> Perhaps someone else will remember.
>

I can't recall, sorry.

>> -----Original Message-----
>> From: Prarit Bhargava [mailto:prarit@redhat.com]
>> Sent: Thursday, October 01, 2015 10:29 AM
>> To: devel@acpica.org
>> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
>> Brown; linux-acpi@vger.kernel.org
>> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
>> not result in a loud warning
>>
>> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
>> integers") changed the error handling in AcpiGetSleepTypeData such that
>>
>> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
>> (20130517/hwxface-571)
>>
>> is displayed on systems not implementing individual ACPI \_Sx sleep
>> states.
>> Since these states are optional the loud warning is incorrect.  This patch
>> changes the kernel to the older behaviour of not warning on a missing
>> \_Sx.
>>
>> Before patch:
>>
>> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>>   ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
>> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
>> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
>> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
>> [root@dell-pem520-03 ~]#
>>
>> After patch:
>>
>> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>> [root@dell-pem520-03 ~]#
>>
>> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
>> 1 or 2 integers")
>> Cc: Robert Moore <robert.moore@intel.com>
>> Cc: Lv Zheng <lv.zheng@intel.com>
>> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>> Cc: Len Brown <lenb@kernel.org>
>> Cc: linux-acpi@vger.kernel.org
>>
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> ---
>>   drivers/acpi/acpica/hwxface.c |   10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
>> index 5f97468..8f50a7f 100644
>> --- a/drivers/acpi/acpica/hwxface.c
>> +++ b/drivers/acpi/acpica/hwxface.c
>> @@ -508,6 +508,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
>> *sleep_type_a, u8 *sleep_type_b)
>>   	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
>>   	status = acpi_ns_evaluate(info);
>>   	if (ACPI_FAILURE(status)) {
>> +		/* \_Sx states are optional */
>>   		goto cleanup;
>>   	}
>>
>> @@ -517,7 +518,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
>> *sleep_type_a, u8 *sleep_type_b)
>>   		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
>> [%s]",
>>   			    info->relative_pathname));
>>   		status = AE_AML_NO_RETURN_VALUE;
>> -		goto cleanup;
>> +		goto cleanup1;
>>   	}
>>
>>   	/* Return object must be of type Package */ @@ -526,7 +527,7 @@
>> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
>> *sleep_type_b)
>>   		ACPI_ERROR((AE_INFO,
>>   			    "Sleep State return object is not a Package"));
>>   		status = AE_AML_OPERAND_TYPE;
>> -		goto cleanup1;
>> +		goto cleanup2;
>>   	}
>>
>>   	/*
>> @@ -570,16 +571,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
>> *sleep_type_a, u8 *sleep_type_b)
>>   		break;
>>   	}
>>
>> -cleanup1:
>> +cleanup2:
>>   	acpi_ut_remove_reference(info->return_object);
>>
>> -cleanup:
>> +cleanup1:
>>   	if (ACPI_FAILURE(status)) {
>>   		ACPI_EXCEPTION((AE_INFO, status,
>>   				"While evaluating Sleep State [%s]",
>>   				info->relative_pathname));
>>   	}
>>
>> +cleanup:
>>   	ACPI_FREE(info);
>>   	return_ACPI_STATUS(status);
>>   }
>> --
>> 1.7.9.3


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
  2015-10-01 22:28   ` Rafael J. Wysocki
@ 2015-10-07 15:28     ` Prarit Bhargava
  2015-10-07 15:52         ` [Devel] " Moore, Robert
  0 siblings, 1 reply; 29+ messages in thread
From: Prarit Bhargava @ 2015-10-07 15:28 UTC (permalink / raw)
  To: Rafael J. Wysocki, Moore, Robert, devel
  Cc: Zheng, Lv, Len Brown, linux-acpi, Box, David E



On 10/01/2015 06:28 PM, Rafael J. Wysocki wrote:
> On 10/1/2015 7:57 PM, Moore, Robert wrote:
>> I seem to remember that this came up a long time ago.
>>
>> Perhaps someone else will remember.
>>
> 
> I can't recall, sorry.

FWIW, a google search on these warnings yields tonnes of comments about them,
but with no resolution AFAICT.

P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-07 15:52         ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-07 15:52 UTC (permalink / raw)
  To: Prarit Bhargava, Wysocki, Rafael J, devel
  Cc: Zheng, Lv, Len Brown, linux-acpi, Box, David E

It would be easy to remove (or partially remove) the warning. Hopefully the calling code will handle AE_NOT_FOUND correctly. 

> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Wednesday, October 07, 2015 8:29 AM
> To: Wysocki, Rafael J; Moore, Robert; devel@acpica.org
> Cc: Zheng, Lv; Len Brown; linux-acpi@vger.kernel.org; Box, David E
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning
> 
> 
> 
> On 10/01/2015 06:28 PM, Rafael J. Wysocki wrote:
> > On 10/1/2015 7:57 PM, Moore, Robert wrote:
> >> I seem to remember that this came up a long time ago.
> >>
> >> Perhaps someone else will remember.
> >>
> >
> > I can't recall, sorry.
> 
> FWIW, a google search on these warnings yields tonnes of comments about
> them, but with no resolution AFAICT.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-07 15:52         ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-07 15:52 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

It would be easy to remove (or partially remove) the warning. Hopefully the calling code will handle AE_NOT_FOUND correctly. 

> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Wednesday, October 07, 2015 8:29 AM
> To: Wysocki, Rafael J; Moore, Robert; devel(a)acpica.org
> Cc: Zheng, Lv; Len Brown; linux-acpi(a)vger.kernel.org; Box, David E
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning
> 
> 
> 
> On 10/01/2015 06:28 PM, Rafael J. Wysocki wrote:
> > On 10/1/2015 7:57 PM, Moore, Robert wrote:
> >> I seem to remember that this came up a long time ago.
> >>
> >> Perhaps someone else will remember.
> >>
> >
> > I can't recall, sorry.
> 
> FWIW, a google search on these warnings yields tonnes of comments about
> them, but with no resolution AFAICT.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
  2015-10-07 15:52         ` [Devel] " Moore, Robert
  (?)
@ 2015-10-07 15:57         ` Prarit Bhargava
  2015-10-07 16:27             ` [Devel] " Moore, Robert
  -1 siblings, 1 reply; 29+ messages in thread
From: Prarit Bhargava @ 2015-10-07 15:57 UTC (permalink / raw)
  To: Moore, Robert, Wysocki, Rafael J, devel
  Cc: Zheng, Lv, Len Brown, linux-acpi, Box, David E



On 10/07/2015 11:52 AM, Moore, Robert wrote:
> It would be easy to remove (or partially remove) the warning. Hopefully the calling code will handle AE_NOT_FOUND correctly. 
> 

In the specific case of the \_Sx sleep states the code does handle the
AE_NOT_FOUND correctly.  The issue is solely the warning being displayed when
there should be no warning.

P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-07 16:27             ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-07 16:27 UTC (permalink / raw)
  To: Prarit Bhargava, Wysocki, Rafael J, devel
  Cc: Zheng, Lv, Len Brown, linux-acpi, Box, David E

I'm thinking that AE_NOT_FOUND should not generate a warning, but any other exception should.


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Wednesday, October 07, 2015 8:57 AM
> To: Moore, Robert; Wysocki, Rafael J; devel@acpica.org
> Cc: Zheng, Lv; Len Brown; linux-acpi@vger.kernel.org; Box, David E
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning
> 
> 
> 
> On 10/07/2015 11:52 AM, Moore, Robert wrote:
> > It would be easy to remove (or partially remove) the warning. Hopefully
> the calling code will handle AE_NOT_FOUND correctly.
> >
> 
> In the specific case of the \_Sx sleep states the code does handle the
> AE_NOT_FOUND correctly.  The issue is solely the warning being displayed
> when there should be no warning.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning
@ 2015-10-07 16:27             ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-07 16:27 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 872 bytes --]

I'm thinking that AE_NOT_FOUND should not generate a warning, but any other exception should.


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Wednesday, October 07, 2015 8:57 AM
> To: Moore, Robert; Wysocki, Rafael J; devel(a)acpica.org
> Cc: Zheng, Lv; Len Brown; linux-acpi(a)vger.kernel.org; Box, David E
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning
> 
> 
> 
> On 10/07/2015 11:52 AM, Moore, Robert wrote:
> > It would be easy to remove (or partially remove) the warning. Hopefully
> the calling code will handle AE_NOT_FOUND correctly.
> >
> 
> In the specific case of the \_Sx sleep states the code does handle the
> AE_NOT_FOUND correctly.  The issue is solely the warning being displayed
> when there should be no warning.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
  2015-10-07 16:27             ` [Devel] " Moore, Robert
  (?)
@ 2015-10-07 18:50             ` Prarit Bhargava
  2015-10-08 14:19                 ` [Devel] " Moore, Robert
  -1 siblings, 1 reply; 29+ messages in thread
From: Prarit Bhargava @ 2015-10-07 18:50 UTC (permalink / raw)
  To: devel
  Cc: Prarit Bhargava, Robert Moore, Lv Zheng, Rafael J. Wysocki,
	Len Brown, linux-acpi

48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
integers") changed the error handling in AcpiGetSleepTypeData such that

ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130517/hwxface-571)

is displayed on systems not implementing individual ACPI \_Sx sleep states.
Since these states are optional the loud warning is incorrect.  This patch
changes the kernel to the older behaviour of not warning on a not found \_Sx.

Before patch:

[root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
 ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130517/hwxface-571)
 ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20130517/hwxface-571)
 ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
[root@dell-pem520-03 ~]#

After patch:

[root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
[root@dell-pem520-03 ~]#

v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn loudly

Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2 integers")
Cc: Robert Moore <robert.moore@intel.com>
Cc: Lv Zheng <lv.zheng@intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 5f97468..b450133 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 	info->relative_pathname =
 	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
 	status = acpi_ns_evaluate(info);
-	if (ACPI_FAILURE(status)) {
+	if (status == AE_NOT_FOUND) {
+		/* \_Sx states are optional */
 		goto cleanup;
 	}
+	if (ACPI_FAILURE(status)) {
+		goto cleanup1;
+	}
 
 	/* Must have a return object */
 
@@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
 			    info->relative_pathname));
 		status = AE_AML_NO_RETURN_VALUE;
-		goto cleanup;
+		goto cleanup1;
 	}
 
 	/* Return object must be of type Package */
@@ -526,7 +530,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO,
 			    "Sleep State return object is not a Package"));
 		status = AE_AML_OPERAND_TYPE;
-		goto cleanup1;
+		goto cleanup2;
 	}
 
 	/*
@@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		break;
 	}
 
-cleanup1:
+cleanup2:
 	acpi_ut_remove_reference(info->return_object);
 
-cleanup:
+cleanup1:
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status,
 				"While evaluating Sleep State [%s]",
 				info->relative_pathname));
 	}
 
+cleanup:
 	ACPI_FREE(info);
 	return_ACPI_STATUS(status);
 }
-- 
1.7.9.3


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-08 14:19                 ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-08 14:19 UTC (permalink / raw)
  To: Prarit Bhargava, devel
  Cc: Zheng, Lv, Wysocki, Rafael J, Len Brown, linux-acpi

We'll do the ACPICA version of this, although with probably with some changes.
Thanks,
Bob


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Wednesday, October 07, 2015 11:51 AM
> To: devel@acpica.org
> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> Brown; linux-acpi@vger.kernel.org
> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> not result in a loud warning [v2]
> 
> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> integers") changed the error handling in AcpiGetSleepTypeData such that
> 
> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)
> 
> is displayed on systems not implementing individual ACPI \_Sx sleep
> states.
> Since these states are optional the loud warning is incorrect.  This patch
> changes the kernel to the older behaviour of not warning on a not found
> \_Sx.
> 
> Before patch:
> 
> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> [root@dell-pem520-03 ~]#
> 
> After patch:
> 
> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> [root@dell-pem520-03 ~]#
> 
> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
> loudly
> 
> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> 1 or 2 integers")
> Cc: Robert Moore <robert.moore@intel.com>
> Cc: Lv Zheng <lv.zheng@intel.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-acpi@vger.kernel.org
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> ---
>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> index 5f97468..b450133 100644
> --- a/drivers/acpi/acpica/hwxface.c
> +++ b/drivers/acpi/acpica/hwxface.c
> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  	info->relative_pathname =
>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
>  	status = acpi_ns_evaluate(info);
> -	if (ACPI_FAILURE(status)) {
> +	if (status == AE_NOT_FOUND) {
> +		/* \_Sx states are optional */
>  		goto cleanup;
>  	}
> +	if (ACPI_FAILURE(status)) {
> +		goto cleanup1;
> +	}
> 
>  	/* Must have a return object */
> 
> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> [%s]",
>  			    info->relative_pathname));
>  		status = AE_AML_NO_RETURN_VALUE;
> -		goto cleanup;
> +		goto cleanup1;
>  	}
> 
>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> *sleep_type_b)
>  		ACPI_ERROR((AE_INFO,
>  			    "Sleep State return object is not a Package"));
>  		status = AE_AML_OPERAND_TYPE;
> -		goto cleanup1;
> +		goto cleanup2;
>  	}
> 
>  	/*
> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		break;
>  	}
> 
> -cleanup1:
> +cleanup2:
>  	acpi_ut_remove_reference(info->return_object);
> 
> -cleanup:
> +cleanup1:
>  	if (ACPI_FAILURE(status)) {
>  		ACPI_EXCEPTION((AE_INFO, status,
>  				"While evaluating Sleep State [%s]",
>  				info->relative_pathname));
>  	}
> 
> +cleanup:
>  	ACPI_FREE(info);
>  	return_ACPI_STATUS(status);
>  }
> --
> 1.7.9.3


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-08 14:19                 ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-08 14:19 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 3925 bytes --]

We'll do the ACPICA version of this, although with probably with some changes.
Thanks,
Bob


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Wednesday, October 07, 2015 11:51 AM
> To: devel(a)acpica.org
> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> Brown; linux-acpi(a)vger.kernel.org
> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> not result in a loud warning [v2]
> 
> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> integers") changed the error handling in AcpiGetSleepTypeData such that
> 
> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)
> 
> is displayed on systems not implementing individual ACPI \_Sx sleep
> states.
> Since these states are optional the loud warning is incorrect.  This patch
> changes the kernel to the older behaviour of not warning on a not found
> \_Sx.
> 
> Before patch:
> 
> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> [root(a)dell-pem520-03 ~]#
> 
> After patch:
> 
> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> [root(a)dell-pem520-03 ~]#
> 
> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
> loudly
> 
> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> 1 or 2 integers")
> Cc: Robert Moore <robert.moore(a)intel.com>
> Cc: Lv Zheng <lv.zheng(a)intel.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
> Cc: Len Brown <lenb(a)kernel.org>
> Cc: linux-acpi(a)vger.kernel.org
> Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
> ---
>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> index 5f97468..b450133 100644
> --- a/drivers/acpi/acpica/hwxface.c
> +++ b/drivers/acpi/acpica/hwxface.c
> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  	info->relative_pathname =
>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
>  	status = acpi_ns_evaluate(info);
> -	if (ACPI_FAILURE(status)) {
> +	if (status == AE_NOT_FOUND) {
> +		/* \_Sx states are optional */
>  		goto cleanup;
>  	}
> +	if (ACPI_FAILURE(status)) {
> +		goto cleanup1;
> +	}
> 
>  	/* Must have a return object */
> 
> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> [%s]",
>  			    info->relative_pathname));
>  		status = AE_AML_NO_RETURN_VALUE;
> -		goto cleanup;
> +		goto cleanup1;
>  	}
> 
>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> *sleep_type_b)
>  		ACPI_ERROR((AE_INFO,
>  			    "Sleep State return object is not a Package"));
>  		status = AE_AML_OPERAND_TYPE;
> -		goto cleanup1;
> +		goto cleanup2;
>  	}
> 
>  	/*
> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> *sleep_type_a, u8 *sleep_type_b)
>  		break;
>  	}
> 
> -cleanup1:
> +cleanup2:
>  	acpi_ut_remove_reference(info->return_object);
> 
> -cleanup:
> +cleanup1:
>  	if (ACPI_FAILURE(status)) {
>  		ACPI_EXCEPTION((AE_INFO, status,
>  				"While evaluating Sleep State [%s]",
>  				info->relative_pathname));
>  	}
> 
> +cleanup:
>  	ACPI_FREE(info);
>  	return_ACPI_STATUS(status);
>  }
> --
> 1.7.9.3


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
  2015-10-08 14:19                 ` [Devel] " Moore, Robert
  (?)
@ 2015-10-08 14:23                 ` Prarit Bhargava
  2015-10-09  2:02                     ` [Devel] " Zheng, Lv
  -1 siblings, 1 reply; 29+ messages in thread
From: Prarit Bhargava @ 2015-10-08 14:23 UTC (permalink / raw)
  To: Moore, Robert, devel; +Cc: Zheng, Lv, Wysocki, Rafael J, Len Brown, linux-acpi



On 10/08/2015 10:19 AM, Moore, Robert wrote:
> We'll do the ACPICA version of this, although with probably with some changes.
> Thanks,

Thanks Bob.  If you could let me know when this lands in github(?) that would be
great.  I'll reference it in the backport upstream.

P.

> Bob
> 
> 
>> -----Original Message-----
>> From: Prarit Bhargava [mailto:prarit@redhat.com]
>> Sent: Wednesday, October 07, 2015 11:51 AM
>> To: devel@acpica.org
>> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
>> Brown; linux-acpi@vger.kernel.org
>> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
>> not result in a loud warning [v2]
>>
>> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
>> integers") changed the error handling in AcpiGetSleepTypeData such that
>>
>> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
>> (20130517/hwxface-571)
>>
>> is displayed on systems not implementing individual ACPI \_Sx sleep
>> states.
>> Since these states are optional the loud warning is incorrect.  This patch
>> changes the kernel to the older behaviour of not warning on a not found
>> \_Sx.
>>
>> Before patch:
>>
>> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
>> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
>> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
>> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
>> [root@dell-pem520-03 ~]#
>>
>> After patch:
>>
>> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
>> [root@dell-pem520-03 ~]#
>>
>> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
>> loudly
>>
>> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
>> 1 or 2 integers")
>> Cc: Robert Moore <robert.moore@intel.com>
>> Cc: Lv Zheng <lv.zheng@intel.com>
>> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>> Cc: Len Brown <lenb@kernel.org>
>> Cc: linux-acpi@vger.kernel.org
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> ---
>>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
>>  1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
>> index 5f97468..b450133 100644
>> --- a/drivers/acpi/acpica/hwxface.c
>> +++ b/drivers/acpi/acpica/hwxface.c
>> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
>> *sleep_type_a, u8 *sleep_type_b)
>>  	info->relative_pathname =
>>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
>>  	status = acpi_ns_evaluate(info);
>> -	if (ACPI_FAILURE(status)) {
>> +	if (status == AE_NOT_FOUND) {
>> +		/* \_Sx states are optional */
>>  		goto cleanup;
>>  	}
>> +	if (ACPI_FAILURE(status)) {
>> +		goto cleanup1;
>> +	}
>>
>>  	/* Must have a return object */
>>
>> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
>> *sleep_type_a, u8 *sleep_type_b)
>>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
>> [%s]",
>>  			    info->relative_pathname));
>>  		status = AE_AML_NO_RETURN_VALUE;
>> -		goto cleanup;
>> +		goto cleanup1;
>>  	}
>>
>>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
>> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
>> *sleep_type_b)
>>  		ACPI_ERROR((AE_INFO,
>>  			    "Sleep State return object is not a Package"));
>>  		status = AE_AML_OPERAND_TYPE;
>> -		goto cleanup1;
>> +		goto cleanup2;
>>  	}
>>
>>  	/*
>> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
>> *sleep_type_a, u8 *sleep_type_b)
>>  		break;
>>  	}
>>
>> -cleanup1:
>> +cleanup2:
>>  	acpi_ut_remove_reference(info->return_object);
>>
>> -cleanup:
>> +cleanup1:
>>  	if (ACPI_FAILURE(status)) {
>>  		ACPI_EXCEPTION((AE_INFO, status,
>>  				"While evaluating Sleep State [%s]",
>>  				info->relative_pathname));
>>  	}
>>
>> +cleanup:
>>  	ACPI_FREE(info);
>>  	return_ACPI_STATUS(status);
>>  }
>> --
>> 1.7.9.3
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-09  2:02                     ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-09  2:02 UTC (permalink / raw)
  To: Prarit Bhargava, Moore, Robert, devel
  Cc: Wysocki, Rafael J, Len Brown, linux-acpi

Why don't you fix this in the invoker side?
For example:
If (acpi_get_handle())
	acpi_evaluate_object()
So that the AE_NOT_FOUND warning can still be kept for the real troubles?
There are really scenarios that such warning is useful for catching bugs.

Thanks and best regards
-Lv

> -----Original Message-----
> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Prarit Bhargava
> Sent: Thursday, October 08, 2015 10:23 PM
> To: Moore, Robert; devel@acpica.org
> Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; linux-acpi@vger.kernel.org
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> 
> 
> 
> On 10/08/2015 10:19 AM, Moore, Robert wrote:
> > We'll do the ACPICA version of this, although with probably with some changes.
> > Thanks,
> 
> Thanks Bob.  If you could let me know when this lands in github(?) that would be
> great.  I'll reference it in the backport upstream.
> 
> P.
> 
> > Bob
> >
> >
> >> -----Original Message-----
> >> From: Prarit Bhargava [mailto:prarit@redhat.com]
> >> Sent: Wednesday, October 07, 2015 11:51 AM
> >> To: devel@acpica.org
> >> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> >> Brown; linux-acpi@vger.kernel.org
> >> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> >> not result in a loud warning [v2]
> >>
> >> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> >> integers") changed the error handling in AcpiGetSleepTypeData such that
> >>
> >> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> >> (20130517/hwxface-571)
> >>
> >> is displayed on systems not implementing individual ACPI \_Sx sleep
> >> states.
> >> Since these states are optional the loud warning is incorrect.  This patch
> >> changes the kernel to the older behaviour of not warning on a not found
> >> \_Sx.
> >>
> >> Before patch:
> >>
> >> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> >>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> >> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> >> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> >> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> >> [root@dell-pem520-03 ~]#
> >>
> >> After patch:
> >>
> >> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> >> [root@dell-pem520-03 ~]#
> >>
> >> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
> >> loudly
> >>
> >> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> >> 1 or 2 integers")
> >> Cc: Robert Moore <robert.moore@intel.com>
> >> Cc: Lv Zheng <lv.zheng@intel.com>
> >> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> >> Cc: Len Brown <lenb@kernel.org>
> >> Cc: linux-acpi@vger.kernel.org
> >> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> >> ---
> >>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
> >>  1 file changed, 10 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> >> index 5f97468..b450133 100644
> >> --- a/drivers/acpi/acpica/hwxface.c
> >> +++ b/drivers/acpi/acpica/hwxface.c
> >> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> >> *sleep_type_a, u8 *sleep_type_b)
> >>  	info->relative_pathname =
> >>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
> >>  	status = acpi_ns_evaluate(info);
> >> -	if (ACPI_FAILURE(status)) {
> >> +	if (status == AE_NOT_FOUND) {
> >> +		/* \_Sx states are optional */
> >>  		goto cleanup;
> >>  	}
> >> +	if (ACPI_FAILURE(status)) {
> >> +		goto cleanup1;
> >> +	}
> >>
> >>  	/* Must have a return object */
> >>
> >> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> >> *sleep_type_a, u8 *sleep_type_b)
> >>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> >> [%s]",
> >>  			    info->relative_pathname));
> >>  		status = AE_AML_NO_RETURN_VALUE;
> >> -		goto cleanup;
> >> +		goto cleanup1;
> >>  	}
> >>
> >>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
> >> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> >> *sleep_type_b)
> >>  		ACPI_ERROR((AE_INFO,
> >>  			    "Sleep State return object is not a Package"));
> >>  		status = AE_AML_OPERAND_TYPE;
> >> -		goto cleanup1;
> >> +		goto cleanup2;
> >>  	}
> >>
> >>  	/*
> >> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> >> *sleep_type_a, u8 *sleep_type_b)
> >>  		break;
> >>  	}
> >>
> >> -cleanup1:
> >> +cleanup2:
> >>  	acpi_ut_remove_reference(info->return_object);
> >>
> >> -cleanup:
> >> +cleanup1:
> >>  	if (ACPI_FAILURE(status)) {
> >>  		ACPI_EXCEPTION((AE_INFO, status,
> >>  				"While evaluating Sleep State [%s]",
> >>  				info->relative_pathname));
> >>  	}
> >>
> >> +cleanup:
> >>  	ACPI_FREE(info);
> >>  	return_ACPI_STATUS(status);
> >>  }
> >> --
> >> 1.7.9.3
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-09  2:02                     ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-09  2:02 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 5414 bytes --]

Why don't you fix this in the invoker side?
For example:
If (acpi_get_handle())
	acpi_evaluate_object()
So that the AE_NOT_FOUND warning can still be kept for the real troubles?
There are really scenarios that such warning is useful for catching bugs.

Thanks and best regards
-Lv

> -----Original Message-----
> From: linux-acpi-owner(a)vger.kernel.org [mailto:linux-acpi-owner(a)vger.kernel.org] On Behalf Of Prarit Bhargava
> Sent: Thursday, October 08, 2015 10:23 PM
> To: Moore, Robert; devel(a)acpica.org
> Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; linux-acpi(a)vger.kernel.org
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> 
> 
> 
> On 10/08/2015 10:19 AM, Moore, Robert wrote:
> > We'll do the ACPICA version of this, although with probably with some changes.
> > Thanks,
> 
> Thanks Bob.  If you could let me know when this lands in github(?) that would be
> great.  I'll reference it in the backport upstream.
> 
> P.
> 
> > Bob
> >
> >
> >> -----Original Message-----
> >> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> >> Sent: Wednesday, October 07, 2015 11:51 AM
> >> To: devel(a)acpica.org
> >> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> >> Brown; linux-acpi(a)vger.kernel.org
> >> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> >> not result in a loud warning [v2]
> >>
> >> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> >> integers") changed the error handling in AcpiGetSleepTypeData such that
> >>
> >> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> >> (20130517/hwxface-571)
> >>
> >> is displayed on systems not implementing individual ACPI \_Sx sleep
> >> states.
> >> Since these states are optional the loud warning is incorrect.  This patch
> >> changes the kernel to the older behaviour of not warning on a not found
> >> \_Sx.
> >>
> >> Before patch:
> >>
> >> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> >>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> >> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> >> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> >> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> >> [root(a)dell-pem520-03 ~]#
> >>
> >> After patch:
> >>
> >> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> >> [root(a)dell-pem520-03 ~]#
> >>
> >> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
> >> loudly
> >>
> >> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> >> 1 or 2 integers")
> >> Cc: Robert Moore <robert.moore(a)intel.com>
> >> Cc: Lv Zheng <lv.zheng(a)intel.com>
> >> Cc: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
> >> Cc: Len Brown <lenb(a)kernel.org>
> >> Cc: linux-acpi(a)vger.kernel.org
> >> Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
> >> ---
> >>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
> >>  1 file changed, 10 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> >> index 5f97468..b450133 100644
> >> --- a/drivers/acpi/acpica/hwxface.c
> >> +++ b/drivers/acpi/acpica/hwxface.c
> >> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> >> *sleep_type_a, u8 *sleep_type_b)
> >>  	info->relative_pathname =
> >>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
> >>  	status = acpi_ns_evaluate(info);
> >> -	if (ACPI_FAILURE(status)) {
> >> +	if (status == AE_NOT_FOUND) {
> >> +		/* \_Sx states are optional */
> >>  		goto cleanup;
> >>  	}
> >> +	if (ACPI_FAILURE(status)) {
> >> +		goto cleanup1;
> >> +	}
> >>
> >>  	/* Must have a return object */
> >>
> >> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> >> *sleep_type_a, u8 *sleep_type_b)
> >>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> >> [%s]",
> >>  			    info->relative_pathname));
> >>  		status = AE_AML_NO_RETURN_VALUE;
> >> -		goto cleanup;
> >> +		goto cleanup1;
> >>  	}
> >>
> >>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
> >> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> >> *sleep_type_b)
> >>  		ACPI_ERROR((AE_INFO,
> >>  			    "Sleep State return object is not a Package"));
> >>  		status = AE_AML_OPERAND_TYPE;
> >> -		goto cleanup1;
> >> +		goto cleanup2;
> >>  	}
> >>
> >>  	/*
> >> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> >> *sleep_type_a, u8 *sleep_type_b)
> >>  		break;
> >>  	}
> >>
> >> -cleanup1:
> >> +cleanup2:
> >>  	acpi_ut_remove_reference(info->return_object);
> >>
> >> -cleanup:
> >> +cleanup1:
> >>  	if (ACPI_FAILURE(status)) {
> >>  		ACPI_EXCEPTION((AE_INFO, status,
> >>  				"While evaluating Sleep State [%s]",
> >>  				info->relative_pathname));
> >>  	}
> >>
> >> +cleanup:
> >>  	ACPI_FREE(info);
> >>  	return_ACPI_STATUS(status);
> >>  }
> >> --
> >> 1.7.9.3
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-09  5:26                       ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-09  5:26 UTC (permalink / raw)
  To: Zheng, Lv, Prarit Bhargava, Moore, Robert, devel
  Cc: linux-acpi, Wysocki, Rafael J

Please ignore this.
The fix is against the caller.

Thanks and best regards
-Lv

> -----Original Message-----
> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng, Lv
> Sent: Friday, October 09, 2015 10:02 AM
> To: Prarit Bhargava; Moore, Robert; devel@acpica.org
> Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
> Subject: Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> 
> Why don't you fix this in the invoker side?
> For example:
> If (acpi_get_handle())
> 	acpi_evaluate_object()
> So that the AE_NOT_FOUND warning can still be kept for the real troubles?
> There are really scenarios that such warning is useful for catching bugs.
> 
> Thanks and best regards
> -Lv
> 
> > -----Original Message-----
> > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Prarit Bhargava
> > Sent: Thursday, October 08, 2015 10:23 PM
> > To: Moore, Robert; devel@acpica.org
> > Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; linux-acpi@vger.kernel.org
> > Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> >
> >
> >
> > On 10/08/2015 10:19 AM, Moore, Robert wrote:
> > > We'll do the ACPICA version of this, although with probably with some changes.
> > > Thanks,
> >
> > Thanks Bob.  If you could let me know when this lands in github(?) that would be
> > great.  I'll reference it in the backport upstream.
> >
> > P.
> >
> > > Bob
> > >
> > >
> > >> -----Original Message-----
> > >> From: Prarit Bhargava [mailto:prarit@redhat.com]
> > >> Sent: Wednesday, October 07, 2015 11:51 AM
> > >> To: devel@acpica.org
> > >> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> > >> Brown; linux-acpi@vger.kernel.org
> > >> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> > >> not result in a loud warning [v2]
> > >>
> > >> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> > >> integers") changed the error handling in AcpiGetSleepTypeData such that
> > >>
> > >> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> > >> (20130517/hwxface-571)
> > >>
> > >> is displayed on systems not implementing individual ACPI \_Sx sleep
> > >> states.
> > >> Since these states are optional the loud warning is incorrect.  This patch
> > >> changes the kernel to the older behaviour of not warning on a not found
> > >> \_Sx.
> > >>
> > >> Before patch:
> > >>
> > >> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> > >>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> > >> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> > >> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> > >> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> > >> [root@dell-pem520-03 ~]#
> > >>
> > >> After patch:
> > >>
> > >> [root@dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> > >> [root@dell-pem520-03 ~]#
> > >>
> > >> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
> > >> loudly
> > >>
> > >> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> > >> 1 or 2 integers")
> > >> Cc: Robert Moore <robert.moore@intel.com>
> > >> Cc: Lv Zheng <lv.zheng@intel.com>
> > >> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> > >> Cc: Len Brown <lenb@kernel.org>
> > >> Cc: linux-acpi@vger.kernel.org
> > >> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> > >> ---
> > >>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
> > >>  1 file changed, 10 insertions(+), 5 deletions(-)
> > >>
> > >> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> > >> index 5f97468..b450133 100644
> > >> --- a/drivers/acpi/acpica/hwxface.c
> > >> +++ b/drivers/acpi/acpica/hwxface.c
> > >> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> > >> *sleep_type_a, u8 *sleep_type_b)
> > >>  	info->relative_pathname =
> > >>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
> > >>  	status = acpi_ns_evaluate(info);
> > >> -	if (ACPI_FAILURE(status)) {
> > >> +	if (status == AE_NOT_FOUND) {
> > >> +		/* \_Sx states are optional */
> > >>  		goto cleanup;
> > >>  	}
> > >> +	if (ACPI_FAILURE(status)) {
> > >> +		goto cleanup1;
> > >> +	}
> > >>
> > >>  	/* Must have a return object */
> > >>
> > >> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> > >> *sleep_type_a, u8 *sleep_type_b)
> > >>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> > >> [%s]",
> > >>  			    info->relative_pathname));
> > >>  		status = AE_AML_NO_RETURN_VALUE;
> > >> -		goto cleanup;
> > >> +		goto cleanup1;
> > >>  	}
> > >>
> > >>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
> > >> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> > >> *sleep_type_b)
> > >>  		ACPI_ERROR((AE_INFO,
> > >>  			    "Sleep State return object is not a Package"));
> > >>  		status = AE_AML_OPERAND_TYPE;
> > >> -		goto cleanup1;
> > >> +		goto cleanup2;
> > >>  	}
> > >>
> > >>  	/*
> > >> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> > >> *sleep_type_a, u8 *sleep_type_b)
> > >>  		break;
> > >>  	}
> > >>
> > >> -cleanup1:
> > >> +cleanup2:
> > >>  	acpi_ut_remove_reference(info->return_object);
> > >>
> > >> -cleanup:
> > >> +cleanup1:
> > >>  	if (ACPI_FAILURE(status)) {
> > >>  		ACPI_EXCEPTION((AE_INFO, status,
> > >>  				"While evaluating Sleep State [%s]",
> > >>  				info->relative_pathname));
> > >>  	}
> > >>
> > >> +cleanup:
> > >>  	ACPI_FREE(info);
> > >>  	return_ACPI_STATUS(status);
> > >>  }
> > >> --
> > >> 1.7.9.3
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> _______________________________________________
> Devel mailing list
> Devel@acpica.org
> https://lists.acpica.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-09  5:26                       ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-09  5:26 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 6329 bytes --]

Please ignore this.
The fix is against the caller.

Thanks and best regards
-Lv

> -----Original Message-----
> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng, Lv
> Sent: Friday, October 09, 2015 10:02 AM
> To: Prarit Bhargava; Moore, Robert; devel(a)acpica.org
> Cc: linux-acpi(a)vger.kernel.org; Wysocki, Rafael J
> Subject: Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> 
> Why don't you fix this in the invoker side?
> For example:
> If (acpi_get_handle())
> 	acpi_evaluate_object()
> So that the AE_NOT_FOUND warning can still be kept for the real troubles?
> There are really scenarios that such warning is useful for catching bugs.
> 
> Thanks and best regards
> -Lv
> 
> > -----Original Message-----
> > From: linux-acpi-owner(a)vger.kernel.org [mailto:linux-acpi-owner(a)vger.kernel.org] On Behalf Of Prarit Bhargava
> > Sent: Thursday, October 08, 2015 10:23 PM
> > To: Moore, Robert; devel(a)acpica.org
> > Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; linux-acpi(a)vger.kernel.org
> > Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> >
> >
> >
> > On 10/08/2015 10:19 AM, Moore, Robert wrote:
> > > We'll do the ACPICA version of this, although with probably with some changes.
> > > Thanks,
> >
> > Thanks Bob.  If you could let me know when this lands in github(?) that would be
> > great.  I'll reference it in the backport upstream.
> >
> > P.
> >
> > > Bob
> > >
> > >
> > >> -----Original Message-----
> > >> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> > >> Sent: Wednesday, October 07, 2015 11:51 AM
> > >> To: devel(a)acpica.org
> > >> Cc: Prarit Bhargava; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> > >> Brown; linux-acpi(a)vger.kernel.org
> > >> Subject: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should
> > >> not result in a loud warning [v2]
> > >>
> > >> 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2
> > >> integers") changed the error handling in AcpiGetSleepTypeData such that
> > >>
> > >> ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> > >> (20130517/hwxface-571)
> > >>
> > >> is displayed on systems not implementing individual ACPI \_Sx sleep
> > >> states.
> > >> Since these states are optional the loud warning is incorrect.  This patch
> > >> changes the kernel to the older behaviour of not warning on a not found
> > >> \_Sx.
> > >>
> > >> Before patch:
> > >>
> > >> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> > >>  ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_]
> > >> (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND, While evaluating
> > >> Sleep State [\_S2_] (20130517/hwxface-571)  ACPI Exception: AE_NOT_FOUND,
> > >> While evaluating Sleep State [\_S3_] (20130517/hwxface-571)
> > >> [root(a)dell-pem520-03 ~]#
> > >>
> > >> After patch:
> > >>
> > >> [root(a)dell-pem520-03 ~]# dmesg | grep "While evaluating Sleep State"
> > >> [root(a)dell-pem520-03 ~]#
> > >>
> > >> v2: Suggested by Robert Moore: Do not warn on AE_NOT_FOUND, otherwise warn
> > >> loudly
> > >>
> > >> Fixes: 48ffb94 ("ACPICA: AcpiGetSleepTypeData: Allow \_Sx to return either
> > >> 1 or 2 integers")
> > >> Cc: Robert Moore <robert.moore(a)intel.com>
> > >> Cc: Lv Zheng <lv.zheng(a)intel.com>
> > >> Cc: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
> > >> Cc: Len Brown <lenb(a)kernel.org>
> > >> Cc: linux-acpi(a)vger.kernel.org
> > >> Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
> > >> ---
> > >>  drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
> > >>  1 file changed, 10 insertions(+), 5 deletions(-)
> > >>
> > >> diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
> > >> index 5f97468..b450133 100644
> > >> --- a/drivers/acpi/acpica/hwxface.c
> > >> +++ b/drivers/acpi/acpica/hwxface.c
> > >> @@ -507,9 +507,13 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> > >> *sleep_type_a, u8 *sleep_type_b)
> > >>  	info->relative_pathname =
> > >>  	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
> > >>  	status = acpi_ns_evaluate(info);
> > >> -	if (ACPI_FAILURE(status)) {
> > >> +	if (status == AE_NOT_FOUND) {
> > >> +		/* \_Sx states are optional */
> > >>  		goto cleanup;
> > >>  	}
> > >> +	if (ACPI_FAILURE(status)) {
> > >> +		goto cleanup1;
> > >> +	}
> > >>
> > >>  	/* Must have a return object */
> > >>
> > >> @@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> > >> *sleep_type_a, u8 *sleep_type_b)
> > >>  		ACPI_ERROR((AE_INFO, "No Sleep State object returned from
> > >> [%s]",
> > >>  			    info->relative_pathname));
> > >>  		status = AE_AML_NO_RETURN_VALUE;
> > >> -		goto cleanup;
> > >> +		goto cleanup1;
> > >>  	}
> > >>
> > >>  	/* Return object must be of type Package */ @@ -526,7 +530,7 @@
> > >> acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8
> > >> *sleep_type_b)
> > >>  		ACPI_ERROR((AE_INFO,
> > >>  			    "Sleep State return object is not a Package"));
> > >>  		status = AE_AML_OPERAND_TYPE;
> > >> -		goto cleanup1;
> > >> +		goto cleanup2;
> > >>  	}
> > >>
> > >>  	/*
> > >> @@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8
> > >> *sleep_type_a, u8 *sleep_type_b)
> > >>  		break;
> > >>  	}
> > >>
> > >> -cleanup1:
> > >> +cleanup2:
> > >>  	acpi_ut_remove_reference(info->return_object);
> > >>
> > >> -cleanup:
> > >> +cleanup1:
> > >>  	if (ACPI_FAILURE(status)) {
> > >>  		ACPI_EXCEPTION((AE_INFO, status,
> > >>  				"While evaluating Sleep State [%s]",
> > >>  				info->relative_pathname));
> > >>  	}
> > >>
> > >> +cleanup:
> > >>  	ACPI_FREE(info);
> > >>  	return_ACPI_STATUS(status);
> > >>  }
> > >> --
> > >> 1.7.9.3
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > the body of a message to majordomo(a)vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> _______________________________________________
> Devel mailing list
> Devel(a)acpica.org
> https://lists.acpica.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
  2015-10-09  5:26                       ` [Devel] " Zheng, Lv
  (?)
@ 2015-10-09 11:29                       ` Prarit Bhargava
  2015-10-09 14:04                           ` [Devel] " Moore, Robert
                                           ` (2 more replies)
  -1 siblings, 3 replies; 29+ messages in thread
From: Prarit Bhargava @ 2015-10-09 11:29 UTC (permalink / raw)
  To: Zheng, Lv, Moore, Robert, devel; +Cc: linux-acpi, Wysocki, Rafael J



On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> Please ignore this.
> The fix is against the caller.
> 
> Thanks and best regards
> -Lv
> 
>> -----Original Message-----
>> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng, Lv
>> Sent: Friday, October 09, 2015 10:02 AM
>> To: Prarit Bhargava; Moore, Robert; devel@acpica.org
>> Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
>> Subject: Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
>>
>> Why don't you fix this in the invoker side?
>> For example:
>> If (acpi_get_handle())
>> 	acpi_evaluate_object()

That seems like a sloppy workaround an actual bug in ACPICA.

>> So that the AE_NOT_FOUND warning can still be kept for the real troubles?

The code is warning 100% of the time on something that is optional.

>> There are really scenarios that such warning is useful for catching bugs.
>>

What scenario is possible where this causes a problem?  Issuing an error on
something that is optional is not a good idea.

P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-09 14:04                           ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-09 14:04 UTC (permalink / raw)
  To: Prarit Bhargava, Zheng, Lv, devel; +Cc: linux-acpi, Wysocki, Rafael J

I have no issues with the original solution. We don't warn on other ACPI_NOT_FOUND exceptions.


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Friday, October 09, 2015 4:30 AM
> To: Zheng, Lv; Moore, Robert; devel@acpica.org
> Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning [v2]
> 
> 
> 
> On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > Please ignore this.
> > The fix is against the caller.
> >
> > Thanks and best regards
> > -Lv
> >
> >> -----Original Message-----
> >> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Friday, October 09, 2015 10:02 AM
> >> To: Prarit Bhargava; Moore, Robert; devel@acpica.org
> >> Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
> >> Subject: Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to
> >> find \_Sx should not result in a loud warning [v2]
> >>
> >> Why don't you fix this in the invoker side?
> >> For example:
> >> If (acpi_get_handle())
> >> 	acpi_evaluate_object()
> 
> That seems like a sloppy workaround an actual bug in ACPICA.
> 
> >> So that the AE_NOT_FOUND warning can still be kept for the real
> troubles?
> 
> The code is warning 100% of the time on something that is optional.
> 
> >> There are really scenarios that such warning is useful for catching
> bugs.
> >>
> 
> What scenario is possible where this causes a problem?  Issuing an error
> on something that is optional is not a good idea.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-09 14:04                           ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-09 14:04 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]

I have no issues with the original solution. We don't warn on other ACPI_NOT_FOUND exceptions.


> -----Original Message-----
> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Friday, October 09, 2015 4:30 AM
> To: Zheng, Lv; Moore, Robert; devel(a)acpica.org
> Cc: linux-acpi(a)vger.kernel.org; Wysocki, Rafael J
> Subject: Re: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning [v2]
> 
> 
> 
> On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > Please ignore this.
> > The fix is against the caller.
> >
> > Thanks and best regards
> > -Lv
> >
> >> -----Original Message-----
> >> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Friday, October 09, 2015 10:02 AM
> >> To: Prarit Bhargava; Moore, Robert; devel(a)acpica.org
> >> Cc: linux-acpi(a)vger.kernel.org; Wysocki, Rafael J
> >> Subject: Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to
> >> find \_Sx should not result in a loud warning [v2]
> >>
> >> Why don't you fix this in the invoker side?
> >> For example:
> >> If (acpi_get_handle())
> >> 	acpi_evaluate_object()
> 
> That seems like a sloppy workaround an actual bug in ACPICA.
> 
> >> So that the AE_NOT_FOUND warning can still be kept for the real
> troubles?
> 
> The code is warning 100% of the time on something that is optional.
> 
> >> There are really scenarios that such warning is useful for catching
> bugs.
> >>
> 
> What scenario is possible where this causes a problem?  Issuing an error
> on something that is optional is not a good idea.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-10  1:22                           ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-10  1:22 UTC (permalink / raw)
  To: Prarit Bhargava, Moore, Robert, devel; +Cc: linux-acpi, Wysocki, Rafael J

Hi,

> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Friday, October 09, 2015 7:30 PM
> 
> On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > Please ignore this.
> > The fix is against the caller.

As I said, the previous email is sent due to lack of confirmation.
So you needn't reply the previous message.

Thanks
-Lv

> >
> > Thanks and best regards
> > -Lv
> >
> >> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Friday, October 09, 2015 10:02 AM
> >>
> >> Why don't you fix this in the invoker side?
> >> For example:
> >> If (acpi_get_handle())
> >> 	acpi_evaluate_object()
> 
> That seems like a sloppy workaround an actual bug in ACPICA.
> 
> >> So that the AE_NOT_FOUND warning can still be kept for the real troubles?
> 
> The code is warning 100% of the time on something that is optional.
> 
> >> There are really scenarios that such warning is useful for catching bugs.
> >>
> 
> What scenario is possible where this causes a problem?  Issuing an error on
> something that is optional is not a good idea.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-10  1:22                           ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-10  1:22 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]

Hi,

> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Friday, October 09, 2015 7:30 PM
> 
> On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > Please ignore this.
> > The fix is against the caller.

As I said, the previous email is sent due to lack of confirmation.
So you needn't reply the previous message.

Thanks
-Lv

> >
> > Thanks and best regards
> > -Lv
> >
> >> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Friday, October 09, 2015 10:02 AM
> >>
> >> Why don't you fix this in the invoker side?
> >> For example:
> >> If (acpi_get_handle())
> >> 	acpi_evaluate_object()
> 
> That seems like a sloppy workaround an actual bug in ACPICA.
> 
> >> So that the AE_NOT_FOUND warning can still be kept for the real troubles?
> 
> The code is warning 100% of the time on something that is optional.
> 
> >> There are really scenarios that such warning is useful for catching bugs.
> >>
> 
> What scenario is possible where this causes a problem?  Issuing an error on
> something that is optional is not a good idea.
> 
> P.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-10  1:37                           ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-10  1:37 UTC (permalink / raw)
  To: Prarit Bhargava, Moore, Robert, devel; +Cc: linux-acpi, Wysocki, Rafael J

Hi,

> From: Prarit Bhargava [mailto:prarit@redhat.com]
> Sent: Friday, October 09, 2015 7:30 PM
> 
> On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > Please ignore this.
> > The fix is against the caller.
> >
> > Thanks and best regards
> > -Lv
> >
> >> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Friday, October 09, 2015 10:02 AM
> >>
> >> Why don't you fix this in the invoker side?
> >> For example:
> >> If (acpi_get_handle())
> >> 	acpi_evaluate_object()
> 
> That seems like a sloppy workaround an actual bug in ACPICA.

So let me ignore this which is a reply for a useless question.

> 
> >> So that the AE_NOT_FOUND warning can still be kept for the real troubles?
> 
> The code is warning 100% of the time on something that is optional.

Let me ignore this which is a reply for a useless question.

> 
> >> There are really scenarios that such warning is useful for catching bugs.
> >>
> 
> What scenario is possible where this causes a problem?  Issuing an error on
> something that is optional is not a good idea.

There are several scenarios, let me say some known stuffs about the module level code support.
In AML grammar, module level code (non-object-definition AML opcodes outside of a control method) is legal.
While it is supported in ACPICA in a split way:
1. In the early stage, table loading code only executes those object definition opcodes and links all "if/else/while" AML fragments together.
2. In the late stage, object initialization code will execute such AML fragments before invoking all _INI methods.

1. Since code is not executed in the Windows compliant order during the early table loading stage, some objects are not defined while they should.
2. Even worse, during the early stage, ACPICA may fail the whole table loading process due to AE_NOT_FOUND, leaving us partial initialized objects (the ACPICA AML interpreter implements 2 phases to parse a table to complete the table loading).
Such issue is worked around by deleting the namespace objects created during the early stage if an exception (AE_NOT_FOUND) is encountered.

So you can see, such kind of error is sometime useful for catching AML interpreter issues or BIOS bugs.

Thanks and best regards
-Lv

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-10  1:37                           ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-10  1:37 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

Hi,

> From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> Sent: Friday, October 09, 2015 7:30 PM
> 
> On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > Please ignore this.
> > The fix is against the caller.
> >
> > Thanks and best regards
> > -Lv
> >
> >> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng, Lv
> >> Sent: Friday, October 09, 2015 10:02 AM
> >>
> >> Why don't you fix this in the invoker side?
> >> For example:
> >> If (acpi_get_handle())
> >> 	acpi_evaluate_object()
> 
> That seems like a sloppy workaround an actual bug in ACPICA.

So let me ignore this which is a reply for a useless question.

> 
> >> So that the AE_NOT_FOUND warning can still be kept for the real troubles?
> 
> The code is warning 100% of the time on something that is optional.

Let me ignore this which is a reply for a useless question.

> 
> >> There are really scenarios that such warning is useful for catching bugs.
> >>
> 
> What scenario is possible where this causes a problem?  Issuing an error on
> something that is optional is not a good idea.

There are several scenarios, let me say some known stuffs about the module level code support.
In AML grammar, module level code (non-object-definition AML opcodes outside of a control method) is legal.
While it is supported in ACPICA in a split way:
1. In the early stage, table loading code only executes those object definition opcodes and links all "if/else/while" AML fragments together.
2. In the late stage, object initialization code will execute such AML fragments before invoking all _INI methods.

1. Since code is not executed in the Windows compliant order during the early table loading stage, some objects are not defined while they should.
2. Even worse, during the early stage, ACPICA may fail the whole table loading process due to AE_NOT_FOUND, leaving us partial initialized objects (the ACPICA AML interpreter implements 2 phases to parse a table to complete the table loading).
Such issue is worked around by deleting the namespace objects created during the early stage if an exception (AE_NOT_FOUND) is encountered.

So you can see, such kind of error is sometime useful for catching AML interpreter issues or BIOS bugs.

Thanks and best regards
-Lv

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-13 20:59                             ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-13 20:59 UTC (permalink / raw)
  To: Zheng, Lv, Prarit Bhargava, devel; +Cc: linux-acpi, Wysocki, Rafael J

I'm a bit confused. What does the execution of the _Sx methods have to do with module-level code? Obviously, many times the _Sx objects are implemented as simply named objects, but the table load doesn't care what is and what isn't present.


> -----Original Message-----
> From: Zheng, Lv
> Sent: Friday, October 09, 2015 6:38 PM
> To: Prarit Bhargava; Moore, Robert; devel@acpica.org
> Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
> Subject: RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning [v2]
> 
> Hi,
> 
> > From: Prarit Bhargava [mailto:prarit@redhat.com]
> > Sent: Friday, October 09, 2015 7:30 PM
> >
> > On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > > Please ignore this.
> > > The fix is against the caller.
> > >
> > > Thanks and best regards
> > > -Lv
> > >
> > >> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng,
> > >> Lv
> > >> Sent: Friday, October 09, 2015 10:02 AM
> > >>
> > >> Why don't you fix this in the invoker side?
> > >> For example:
> > >> If (acpi_get_handle())
> > >> 	acpi_evaluate_object()
> >
> > That seems like a sloppy workaround an actual bug in ACPICA.
> 
> So let me ignore this which is a reply for a useless question.
> 
> >
> > >> So that the AE_NOT_FOUND warning can still be kept for the real
> troubles?
> >
> > The code is warning 100% of the time on something that is optional.
> 
> Let me ignore this which is a reply for a useless question.
> 
> >
> > >> There are really scenarios that such warning is useful for catching
> bugs.
> > >>
> >
> > What scenario is possible where this causes a problem?  Issuing an
> > error on something that is optional is not a good idea.
> 
> There are several scenarios, let me say some known stuffs about the module
> level code support.
> In AML grammar, module level code (non-object-definition AML opcodes
> outside of a control method) is legal.
> While it is supported in ACPICA in a split way:
> 1. In the early stage, table loading code only executes those object
> definition opcodes and links all "if/else/while" AML fragments together.
> 2. In the late stage, object initialization code will execute such AML
> fragments before invoking all _INI methods.
> 
> 1. Since code is not executed in the Windows compliant order during the
> early table loading stage, some objects are not defined while they should.
> 2. Even worse, during the early stage, ACPICA may fail the whole table
> loading process due to AE_NOT_FOUND, leaving us partial initialized
> objects (the ACPICA AML interpreter implements 2 phases to parse a table
> to complete the table loading).
> Such issue is worked around by deleting the namespace objects created
> during the early stage if an exception (AE_NOT_FOUND) is encountered.
> 
> So you can see, such kind of error is sometime useful for catching AML
> interpreter issues or BIOS bugs.
> 
> Thanks and best regards
> -Lv

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-13 20:59                             ` Moore, Robert
  0 siblings, 0 replies; 29+ messages in thread
From: Moore, Robert @ 2015-10-13 20:59 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 3005 bytes --]

I'm a bit confused. What does the execution of the _Sx methods have to do with module-level code? Obviously, many times the _Sx objects are implemented as simply named objects, but the table load doesn't care what is and what isn't present.


> -----Original Message-----
> From: Zheng, Lv
> Sent: Friday, October 09, 2015 6:38 PM
> To: Prarit Bhargava; Moore, Robert; devel(a)acpica.org
> Cc: linux-acpi(a)vger.kernel.org; Wysocki, Rafael J
> Subject: RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> should not result in a loud warning [v2]
> 
> Hi,
> 
> > From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> > Sent: Friday, October 09, 2015 7:30 PM
> >
> > On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > > Please ignore this.
> > > The fix is against the caller.
> > >
> > > Thanks and best regards
> > > -Lv
> > >
> > >> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng,
> > >> Lv
> > >> Sent: Friday, October 09, 2015 10:02 AM
> > >>
> > >> Why don't you fix this in the invoker side?
> > >> For example:
> > >> If (acpi_get_handle())
> > >> 	acpi_evaluate_object()
> >
> > That seems like a sloppy workaround an actual bug in ACPICA.
> 
> So let me ignore this which is a reply for a useless question.
> 
> >
> > >> So that the AE_NOT_FOUND warning can still be kept for the real
> troubles?
> >
> > The code is warning 100% of the time on something that is optional.
> 
> Let me ignore this which is a reply for a useless question.
> 
> >
> > >> There are really scenarios that such warning is useful for catching
> bugs.
> > >>
> >
> > What scenario is possible where this causes a problem?  Issuing an
> > error on something that is optional is not a good idea.
> 
> There are several scenarios, let me say some known stuffs about the module
> level code support.
> In AML grammar, module level code (non-object-definition AML opcodes
> outside of a control method) is legal.
> While it is supported in ACPICA in a split way:
> 1. In the early stage, table loading code only executes those object
> definition opcodes and links all "if/else/while" AML fragments together.
> 2. In the late stage, object initialization code will execute such AML
> fragments before invoking all _INI methods.
> 
> 1. Since code is not executed in the Windows compliant order during the
> early table loading stage, some objects are not defined while they should.
> 2. Even worse, during the early stage, ACPICA may fail the whole table
> loading process due to AE_NOT_FOUND, leaving us partial initialized
> objects (the ACPICA AML interpreter implements 2 phases to parse a table
> to complete the table loading).
> Such issue is worked around by deleting the namespace objects created
> during the early stage if an exception (AE_NOT_FOUND) is encountered.
> 
> So you can see, such kind of error is sometime useful for catching AML
> interpreter issues or BIOS bugs.
> 
> Thanks and best regards
> -Lv

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-14  1:47                               ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-14  1:47 UTC (permalink / raw)
  To: Moore, Robert, Prarit Bhargava, devel; +Cc: linux-acpi, Wysocki, Rafael J

Hi, Bob

> -----Original Message-----
> From: Moore, Robert
> Sent: Wednesday, October 14, 2015 5:00 AM
> To: Zheng, Lv; Prarit Bhargava; devel@acpica.org
> Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
> Subject: RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> 
> I'm a bit confused. What does the execution of the _Sx methods have to do with module-level code? Obviously, many times the _Sx
> objects are implemented as simply named objects, but the table load doesn't care what is and what isn't present.
> 

The AE_NOT_FOUND for _Sx should have been fixed.

What we are talking is not related to the _Sx warning.
I was just replying Prarit that why such kind of warning messages could be useful.

Thanks and best regards
-Lv

> 
> > -----Original Message-----
> > From: Zheng, Lv
> > Sent: Friday, October 09, 2015 6:38 PM
> > To: Prarit Bhargava; Moore, Robert; devel@acpica.org
> > Cc: linux-acpi@vger.kernel.org; Wysocki, Rafael J
> > Subject: RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> > should not result in a loud warning [v2]
> >
> > Hi,
> >
> > > From: Prarit Bhargava [mailto:prarit@redhat.com]
> > > Sent: Friday, October 09, 2015 7:30 PM
> > >
> > > On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > > > Please ignore this.
> > > > The fix is against the caller.
> > > >
> > > > Thanks and best regards
> > > > -Lv
> > > >
> > > >> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Zheng,
> > > >> Lv
> > > >> Sent: Friday, October 09, 2015 10:02 AM
> > > >>
> > > >> Why don't you fix this in the invoker side?
> > > >> For example:
> > > >> If (acpi_get_handle())
> > > >> 	acpi_evaluate_object()
> > >
> > > That seems like a sloppy workaround an actual bug in ACPICA.
> >
> > So let me ignore this which is a reply for a useless question.
> >
> > >
> > > >> So that the AE_NOT_FOUND warning can still be kept for the real
> > troubles?
> > >
> > > The code is warning 100% of the time on something that is optional.
> >
> > Let me ignore this which is a reply for a useless question.
> >
> > >
> > > >> There are really scenarios that such warning is useful for catching
> > bugs.
> > > >>
> > >
> > > What scenario is possible where this causes a problem?  Issuing an
> > > error on something that is optional is not a good idea.
> >
> > There are several scenarios, let me say some known stuffs about the module
> > level code support.
> > In AML grammar, module level code (non-object-definition AML opcodes
> > outside of a control method) is legal.
> > While it is supported in ACPICA in a split way:
> > 1. In the early stage, table loading code only executes those object
> > definition opcodes and links all "if/else/while" AML fragments together.
> > 2. In the late stage, object initialization code will execute such AML
> > fragments before invoking all _INI methods.
> >
> > 1. Since code is not executed in the Windows compliant order during the
> > early table loading stage, some objects are not defined while they should.
> > 2. Even worse, during the early stage, ACPICA may fail the whole table
> > loading process due to AE_NOT_FOUND, leaving us partial initialized
> > objects (the ACPICA AML interpreter implements 2 phases to parse a table
> > to complete the table loading).
> > Such issue is worked around by deleting the namespace objects created
> > during the early stage if an exception (AE_NOT_FOUND) is encountered.
> >
> > So you can see, such kind of error is sometime useful for catching AML
> > interpreter issues or BIOS bugs.
> >
> > Thanks and best regards
> > -Lv

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Devel] [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
@ 2015-10-14  1:47                               ` Zheng, Lv
  0 siblings, 0 replies; 29+ messages in thread
From: Zheng, Lv @ 2015-10-14  1:47 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 3716 bytes --]

Hi, Bob

> -----Original Message-----
> From: Moore, Robert
> Sent: Wednesday, October 14, 2015 5:00 AM
> To: Zheng, Lv; Prarit Bhargava; devel(a)acpica.org
> Cc: linux-acpi(a)vger.kernel.org; Wysocki, Rafael J
> Subject: RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2]
> 
> I'm a bit confused. What does the execution of the _Sx methods have to do with module-level code? Obviously, many times the _Sx
> objects are implemented as simply named objects, but the table load doesn't care what is and what isn't present.
> 

The AE_NOT_FOUND for _Sx should have been fixed.

What we are talking is not related to the _Sx warning.
I was just replying Prarit that why such kind of warning messages could be useful.

Thanks and best regards
-Lv

> 
> > -----Original Message-----
> > From: Zheng, Lv
> > Sent: Friday, October 09, 2015 6:38 PM
> > To: Prarit Bhargava; Moore, Robert; devel(a)acpica.org
> > Cc: linux-acpi(a)vger.kernel.org; Wysocki, Rafael J
> > Subject: RE: [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx
> > should not result in a loud warning [v2]
> >
> > Hi,
> >
> > > From: Prarit Bhargava [mailto:prarit(a)redhat.com]
> > > Sent: Friday, October 09, 2015 7:30 PM
> > >
> > > On 10/09/2015 01:26 AM, Zheng, Lv wrote:
> > > > Please ignore this.
> > > > The fix is against the caller.
> > > >
> > > > Thanks and best regards
> > > > -Lv
> > > >
> > > >> From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Zheng,
> > > >> Lv
> > > >> Sent: Friday, October 09, 2015 10:02 AM
> > > >>
> > > >> Why don't you fix this in the invoker side?
> > > >> For example:
> > > >> If (acpi_get_handle())
> > > >> 	acpi_evaluate_object()
> > >
> > > That seems like a sloppy workaround an actual bug in ACPICA.
> >
> > So let me ignore this which is a reply for a useless question.
> >
> > >
> > > >> So that the AE_NOT_FOUND warning can still be kept for the real
> > troubles?
> > >
> > > The code is warning 100% of the time on something that is optional.
> >
> > Let me ignore this which is a reply for a useless question.
> >
> > >
> > > >> There are really scenarios that such warning is useful for catching
> > bugs.
> > > >>
> > >
> > > What scenario is possible where this causes a problem?  Issuing an
> > > error on something that is optional is not a good idea.
> >
> > There are several scenarios, let me say some known stuffs about the module
> > level code support.
> > In AML grammar, module level code (non-object-definition AML opcodes
> > outside of a control method) is legal.
> > While it is supported in ACPICA in a split way:
> > 1. In the early stage, table loading code only executes those object
> > definition opcodes and links all "if/else/while" AML fragments together.
> > 2. In the late stage, object initialization code will execute such AML
> > fragments before invoking all _INI methods.
> >
> > 1. Since code is not executed in the Windows compliant order during the
> > early table loading stage, some objects are not defined while they should.
> > 2. Even worse, during the early stage, ACPICA may fail the whole table
> > loading process due to AE_NOT_FOUND, leaving us partial initialized
> > objects (the ACPICA AML interpreter implements 2 phases to parse a table
> > to complete the table loading).
> > Such issue is worked around by deleting the namespace objects created
> > during the early stage if an exception (AE_NOT_FOUND) is encountered.
> >
> > So you can see, such kind of error is sometime useful for catching AML
> > interpreter issues or BIOS bugs.
> >
> > Thanks and best regards
> > -Lv

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-10-14  1:47 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 17:28 [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning Prarit Bhargava
2015-10-01 17:57 ` Moore, Robert
2015-10-01 17:57   ` [Devel] " Moore, Robert
2015-10-01 22:28   ` Rafael J. Wysocki
2015-10-07 15:28     ` Prarit Bhargava
2015-10-07 15:52       ` Moore, Robert
2015-10-07 15:52         ` [Devel] " Moore, Robert
2015-10-07 15:57         ` Prarit Bhargava
2015-10-07 16:27           ` Moore, Robert
2015-10-07 16:27             ` [Devel] " Moore, Robert
2015-10-07 18:50             ` [PATCH] ACPICA: AcpiGetSleepTypeData: Failure to find \_Sx should not result in a loud warning [v2] Prarit Bhargava
2015-10-08 14:19               ` Moore, Robert
2015-10-08 14:19                 ` [Devel] " Moore, Robert
2015-10-08 14:23                 ` Prarit Bhargava
2015-10-09  2:02                   ` Zheng, Lv
2015-10-09  2:02                     ` [Devel] " Zheng, Lv
2015-10-09  5:26                     ` Zheng, Lv
2015-10-09  5:26                       ` [Devel] " Zheng, Lv
2015-10-09 11:29                       ` Prarit Bhargava
2015-10-09 14:04                         ` Moore, Robert
2015-10-09 14:04                           ` [Devel] " Moore, Robert
2015-10-10  1:22                         ` Zheng, Lv
2015-10-10  1:22                           ` [Devel] " Zheng, Lv
2015-10-10  1:37                         ` Zheng, Lv
2015-10-10  1:37                           ` [Devel] " Zheng, Lv
2015-10-13 20:59                           ` Moore, Robert
2015-10-13 20:59                             ` [Devel] " Moore, Robert
2015-10-14  1:47                             ` Zheng, Lv
2015-10-14  1:47                               ` [Devel] " Zheng, Lv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.