stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support
@ 2016-04-20  2:39 Lv Zheng
  2016-04-20  5:58 ` Greg KH
  2016-04-20 10:27 ` Rafael J. Wysocki
  0 siblings, 2 replies; 5+ messages in thread
From: Lv Zheng @ 2016-04-20  2:39 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, stable, linux-acpi

4.5-stable review patch. If anyone has any objects, please let me know.

---------------

From: Lv Zheng <lv.zheng@intel.com>

commit 5508df89756f8378024828e185724a9bd2348985 upstream.

It is reported that the following commit triggers regressions:
 Linux commit: efaed9be998b5ae0afb7458e057e5f4402b43fa0
 ACPICA commit: 31178590dde82368fdb0f6b0e466b6c0add96c57
 Subject: ACPICA: Events: Enhance acpi_ev_execute_reg_method() to
          ensure no _REG evaluations can happen during OS early boot
          stages

This is because that the ECDT support is not corrected in Linux, and Linux
requires to execute _REG for ECDT (though this sounds so wrong), we need to
ensure acpi_gbl_reg_methods_enabled is set before ECDT probing in order
for _REG to be executed. Since we have to move
"acpi_gbl_reg_methods_enabled = TRUE" to the initialization step
happening before ECDT probing, acpi_load_tables() is the best candidate for
now. Thus this patch fixes the regression by doing so.

But if the ECDT support is fixed, Linux will not execute _REG for ECDT, and
ECDT probing will happen before acpi_load_tables(). At that time, we still
want to ensure acpi_gbl_reg_methods_enabled is set after executing
acpi_ns_initialize_objects() (under the condition of
acpi_gbl_group_module_level_code = FALSE), this patch also moves
acpi_ns_initialize_objects() to acpi_load_tables() accordingly.

Since acpi_ns_initialize_objects() doesn't seem to be skippable, this
patch also removes ACPI_NO_OBJECT_INIT for the one invoked in
acpi_load_tables(). Reported by Chris Bainbridge, Fixed by Lv Zheng.

Fixes: efaed9be998b (ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages)
Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpica/nsinit.c   |    2 ++
 drivers/acpi/acpica/tbxfload.c |   14 ++++++++++++++
 drivers/acpi/acpica/utxfinit.c |   25 +++++++++++--------------
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index bd75d46..ddb436f 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -83,6 +83,8 @@ acpi_status acpi_ns_initialize_objects(void)
 
 	ACPI_FUNCTION_TRACE(ns_initialize_objects);
 
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "[Init] Completing Initialization of ACPI Objects\n"));
 	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
 			  "**** Starting initialization of namespace objects ****\n"));
 	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 278666e..c37d479 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -83,6 +83,20 @@ acpi_status __init acpi_load_tables(void)
 				"While loading namespace from ACPI tables"));
 	}
 
+	if (!acpi_gbl_group_module_level_code) {
+		/*
+		 * Initialize the objects that remain uninitialized. This
+		 * runs the executable AML that may be part of the
+		 * declaration of these objects:
+		 * operation_regions, buffer_fields, Buffers, and Packages.
+		 */
+		status = acpi_ns_initialize_objects();
+		if (ACPI_FAILURE(status)) {
+			return_ACPI_STATUS(status);
+		}
+	}
+
+	acpi_gbl_reg_methods_enabled = TRUE;
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 721b87c..638fbd4 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -267,7 +267,6 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 	 * initialized, even if they contain executable AML (see the call to
 	 * acpi_ns_initialize_objects below).
 	 */
-	acpi_gbl_reg_methods_enabled = TRUE;
 	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
 				  "[Init] Executing _REG OpRegion methods\n"));
@@ -299,20 +298,18 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 	 */
 	if (acpi_gbl_group_module_level_code) {
 		acpi_ns_exec_module_code_list();
-	}
 
-	/*
-	 * Initialize the objects that remain uninitialized. This runs the
-	 * executable AML that may be part of the declaration of these objects:
-	 * operation_regions, buffer_fields, Buffers, and Packages.
-	 */
-	if (!(flags & ACPI_NO_OBJECT_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Completing Initialization of ACPI Objects\n"));
-
-		status = acpi_ns_initialize_objects();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
+		/*
+		 * Initialize the objects that remain uninitialized. This
+		 * runs the executable AML that may be part of the
+		 * declaration of these objects:
+		 * operation_regions, buffer_fields, Buffers, and Packages.
+		 */
+		if (!(flags & ACPI_NO_OBJECT_INIT)) {
+			status = acpi_ns_initialize_objects();
+			if (ACPI_FAILURE(status)) {
+				return_ACPI_STATUS(status);
+			}
 		}
 	}
 
-- 
1.7.10


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

* Re: [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support
  2016-04-20  2:39 [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support Lv Zheng
@ 2016-04-20  5:58 ` Greg KH
  2016-04-22  3:05   ` Zheng, Lv
  2016-04-20 10:27 ` Rafael J. Wysocki
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2016-04-20  5:58 UTC (permalink / raw)
  To: Lv Zheng
  Cc: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown, Lv Zheng, stable,
	linux-acpi

On Wed, Apr 20, 2016 at 10:39:56AM +0800, Lv Zheng wrote:
> 4.5-stable review patch. If anyone has any objects, please let me know.

Huh?  I don't understand this email...



> 
> ---------------
> 
> From: Lv Zheng <lv.zheng@intel.com>
> 
> commit 5508df89756f8378024828e185724a9bd2348985 upstream.
> 
> It is reported that the following commit triggers regressions:
>  Linux commit: efaed9be998b5ae0afb7458e057e5f4402b43fa0
>  ACPICA commit: 31178590dde82368fdb0f6b0e466b6c0add96c57
>  Subject: ACPICA: Events: Enhance acpi_ev_execute_reg_method() to
>           ensure no _REG evaluations can happen during OS early boot
>           stages
> 
> This is because that the ECDT support is not corrected in Linux, and Linux
> requires to execute _REG for ECDT (though this sounds so wrong), we need to
> ensure acpi_gbl_reg_methods_enabled is set before ECDT probing in order
> for _REG to be executed. Since we have to move
> "acpi_gbl_reg_methods_enabled = TRUE" to the initialization step
> happening before ECDT probing, acpi_load_tables() is the best candidate for
> now. Thus this patch fixes the regression by doing so.
> 
> But if the ECDT support is fixed, Linux will not execute _REG for ECDT, and
> ECDT probing will happen before acpi_load_tables(). At that time, we still
> want to ensure acpi_gbl_reg_methods_enabled is set after executing
> acpi_ns_initialize_objects() (under the condition of
> acpi_gbl_group_module_level_code = FALSE), this patch also moves
> acpi_ns_initialize_objects() to acpi_load_tables() accordingly.
> 
> Since acpi_ns_initialize_objects() doesn't seem to be skippable, this
> patch also removes ACPI_NO_OBJECT_INIT for the one invoked in
> acpi_load_tables(). Reported by Chris Bainbridge, Fixed by Lv Zheng.
> 
> Fixes: efaed9be998b (ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages)
> Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/acpi/acpica/nsinit.c   |    2 ++
>  drivers/acpi/acpica/tbxfload.c |   14 ++++++++++++++
>  drivers/acpi/acpica/utxfinit.c |   25 +++++++++++--------------
>  3 files changed, 27 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
> index bd75d46..ddb436f 100644
> --- a/drivers/acpi/acpica/nsinit.c
> +++ b/drivers/acpi/acpica/nsinit.c
> @@ -83,6 +83,8 @@ acpi_status acpi_ns_initialize_objects(void)
>  
>  	ACPI_FUNCTION_TRACE(ns_initialize_objects);
>  
> +	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> +			  "[Init] Completing Initialization of ACPI Objects\n"));
>  	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
>  			  "**** Starting initialization of namespace objects ****\n"));
>  	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
> diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
> index 278666e..c37d479 100644
> --- a/drivers/acpi/acpica/tbxfload.c
> +++ b/drivers/acpi/acpica/tbxfload.c
> @@ -83,6 +83,20 @@ acpi_status __init acpi_load_tables(void)
>  				"While loading namespace from ACPI tables"));
>  	}
>  
> +	if (!acpi_gbl_group_module_level_code) {
> +		/*
> +		 * Initialize the objects that remain uninitialized. This
> +		 * runs the executable AML that may be part of the
> +		 * declaration of these objects:
> +		 * operation_regions, buffer_fields, Buffers, and Packages.
> +		 */
> +		status = acpi_ns_initialize_objects();
> +		if (ACPI_FAILURE(status)) {
> +			return_ACPI_STATUS(status);
> +		}
> +	}
> +
> +	acpi_gbl_reg_methods_enabled = TRUE;
>  	return_ACPI_STATUS(status);
>  }
>  
> diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
> index 721b87c..638fbd4 100644
> --- a/drivers/acpi/acpica/utxfinit.c
> +++ b/drivers/acpi/acpica/utxfinit.c
> @@ -267,7 +267,6 @@ acpi_status __init acpi_initialize_objects(u32 flags)
>  	 * initialized, even if they contain executable AML (see the call to
>  	 * acpi_ns_initialize_objects below).
>  	 */
> -	acpi_gbl_reg_methods_enabled = TRUE;
>  	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
>  		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
>  				  "[Init] Executing _REG OpRegion methods\n"));
> @@ -299,20 +298,18 @@ acpi_status __init acpi_initialize_objects(u32 flags)
>  	 */
>  	if (acpi_gbl_group_module_level_code) {
>  		acpi_ns_exec_module_code_list();
> -	}
>  
> -	/*
> -	 * Initialize the objects that remain uninitialized. This runs the
> -	 * executable AML that may be part of the declaration of these objects:
> -	 * operation_regions, buffer_fields, Buffers, and Packages.
> -	 */
> -	if (!(flags & ACPI_NO_OBJECT_INIT)) {
> -		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> -				  "[Init] Completing Initialization of ACPI Objects\n"));
> -
> -		status = acpi_ns_initialize_objects();
> -		if (ACPI_FAILURE(status)) {
> -			return_ACPI_STATUS(status);
> +		/*
> +		 * Initialize the objects that remain uninitialized. This
> +		 * runs the executable AML that may be part of the
> +		 * declaration of these objects:
> +		 * operation_regions, buffer_fields, Buffers, and Packages.
> +		 */
> +		if (!(flags & ACPI_NO_OBJECT_INIT)) {
> +			status = acpi_ns_initialize_objects();
> +			if (ACPI_FAILURE(status)) {
> +				return_ACPI_STATUS(status);
> +			}
>  		}
>  	}
>  
> -- 
> 1.7.10
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" 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] 5+ messages in thread

* Re: [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support
  2016-04-20  2:39 [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support Lv Zheng
  2016-04-20  5:58 ` Greg KH
@ 2016-04-20 10:27 ` Rafael J. Wysocki
  1 sibling, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2016-04-20 10:27 UTC (permalink / raw)
  To: Lv Zheng
  Cc: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown, Lv Zheng, Stable,
	ACPI Devel Maling List

On Wed, Apr 20, 2016 at 4:39 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> 4.5-stable review patch. If anyone has any objects, please let me know.

This should be a request to the maintainers of -stable trees to apply
the following backport of a mainline commit.  Something like:

"Please take the following backport of mainline commit
5508df89756f8378024828e185724a9bd2348985 to the 4.5.y tree as it fixes
a regression introduced by commit
efaed9be998b5ae0afb7458e057e5f4402b43fa0 (ACPICA: Events: Enhance
acpi_ev_execute_reg_method() to  ensure no _REG evaluations can happen
during OS early boot stages)".

> ---------------
>
> From: Lv Zheng <lv.zheng@intel.com>
>
> commit 5508df89756f8378024828e185724a9bd2348985 upstream.
>
> It is reported that the following commit triggers regressions:
>  Linux commit: efaed9be998b5ae0afb7458e057e5f4402b43fa0
>  ACPICA commit: 31178590dde82368fdb0f6b0e466b6c0add96c57
>  Subject: ACPICA: Events: Enhance acpi_ev_execute_reg_method() to
>           ensure no _REG evaluations can happen during OS early boot
>           stages
>
> This is because that the ECDT support is not corrected in Linux, and Linux
> requires to execute _REG for ECDT (though this sounds so wrong), we need to
> ensure acpi_gbl_reg_methods_enabled is set before ECDT probing in order
> for _REG to be executed. Since we have to move
> "acpi_gbl_reg_methods_enabled = TRUE" to the initialization step
> happening before ECDT probing, acpi_load_tables() is the best candidate for
> now. Thus this patch fixes the regression by doing so.
>
> But if the ECDT support is fixed, Linux will not execute _REG for ECDT, and
> ECDT probing will happen before acpi_load_tables(). At that time, we still
> want to ensure acpi_gbl_reg_methods_enabled is set after executing
> acpi_ns_initialize_objects() (under the condition of
> acpi_gbl_group_module_level_code = FALSE), this patch also moves
> acpi_ns_initialize_objects() to acpi_load_tables() accordingly.
>
> Since acpi_ns_initialize_objects() doesn't seem to be skippable, this
> patch also removes ACPI_NO_OBJECT_INIT for the one invoked in
> acpi_load_tables(). Reported by Chris Bainbridge, Fixed by Lv Zheng.
>
> Fixes: efaed9be998b (ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages)
> Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/acpi/acpica/nsinit.c   |    2 ++
>  drivers/acpi/acpica/tbxfload.c |   14 ++++++++++++++
>  drivers/acpi/acpica/utxfinit.c |   25 +++++++++++--------------
>  3 files changed, 27 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
> index bd75d46..ddb436f 100644
> --- a/drivers/acpi/acpica/nsinit.c
> +++ b/drivers/acpi/acpica/nsinit.c
> @@ -83,6 +83,8 @@ acpi_status acpi_ns_initialize_objects(void)
>
>         ACPI_FUNCTION_TRACE(ns_initialize_objects);
>
> +       ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> +                         "[Init] Completing Initialization of ACPI Objects\n"));
>         ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
>                           "**** Starting initialization of namespace objects ****\n"));
>         ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
> diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
> index 278666e..c37d479 100644
> --- a/drivers/acpi/acpica/tbxfload.c
> +++ b/drivers/acpi/acpica/tbxfload.c
> @@ -83,6 +83,20 @@ acpi_status __init acpi_load_tables(void)
>                                 "While loading namespace from ACPI tables"));
>         }
>
> +       if (!acpi_gbl_group_module_level_code) {
> +               /*
> +                * Initialize the objects that remain uninitialized. This
> +                * runs the executable AML that may be part of the
> +                * declaration of these objects:
> +                * operation_regions, buffer_fields, Buffers, and Packages.
> +                */
> +               status = acpi_ns_initialize_objects();
> +               if (ACPI_FAILURE(status)) {
> +                       return_ACPI_STATUS(status);
> +               }
> +       }
> +
> +       acpi_gbl_reg_methods_enabled = TRUE;
>         return_ACPI_STATUS(status);
>  }
>
> diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
> index 721b87c..638fbd4 100644
> --- a/drivers/acpi/acpica/utxfinit.c
> +++ b/drivers/acpi/acpica/utxfinit.c
> @@ -267,7 +267,6 @@ acpi_status __init acpi_initialize_objects(u32 flags)
>          * initialized, even if they contain executable AML (see the call to
>          * acpi_ns_initialize_objects below).
>          */
> -       acpi_gbl_reg_methods_enabled = TRUE;
>         if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
>                 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
>                                   "[Init] Executing _REG OpRegion methods\n"));
> @@ -299,20 +298,18 @@ acpi_status __init acpi_initialize_objects(u32 flags)
>          */
>         if (acpi_gbl_group_module_level_code) {
>                 acpi_ns_exec_module_code_list();
> -       }
>
> -       /*
> -        * Initialize the objects that remain uninitialized. This runs the
> -        * executable AML that may be part of the declaration of these objects:
> -        * operation_regions, buffer_fields, Buffers, and Packages.
> -        */
> -       if (!(flags & ACPI_NO_OBJECT_INIT)) {
> -               ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> -                                 "[Init] Completing Initialization of ACPI Objects\n"));
> -
> -               status = acpi_ns_initialize_objects();
> -               if (ACPI_FAILURE(status)) {
> -                       return_ACPI_STATUS(status);
> +               /*
> +                * Initialize the objects that remain uninitialized. This
> +                * runs the executable AML that may be part of the
> +                * declaration of these objects:
> +                * operation_regions, buffer_fields, Buffers, and Packages.
> +                */
> +               if (!(flags & ACPI_NO_OBJECT_INIT)) {
> +                       status = acpi_ns_initialize_objects();
> +                       if (ACPI_FAILURE(status)) {
> +                               return_ACPI_STATUS(status);
> +                       }
>                 }
>         }
>
> --
> 1.7.10
>
> --
> 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] 5+ messages in thread

* RE: [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support
  2016-04-20  5:58 ` Greg KH
@ 2016-04-22  3:05   ` Zheng, Lv
  2016-04-22  3:14     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Zheng, Lv @ 2016-04-22  3:05 UTC (permalink / raw)
  To: Greg KH
  Cc: Wysocki, Rafael J, Rafael J. Wysocki, Brown, Len, Lv Zheng,
	stable@vger.kernel.org, linux-acpi@vger.kernel.org

Hi, Greg

> From: Greg KH [mailto:greg@kroah.com]
> Subject: Re: [PATCH] ACPICA / Interpreter: Fix a regression triggered because
> of wrong Linux ECDT support
> 
> On Wed, Apr 20, 2016 at 10:39:56AM +0800, Lv Zheng wrote:
> > 4.5-stable review patch. If anyone has any objects, please let me know.
> 
> Huh?  I don't understand this email...
> 
> 
[Lv Zheng] 

I received an error notice from you on 4/11/2016:
FAILED: patch "[PATCH] ACPICA / Interpreter: Fix a regression triggered because of ACPICA: Events: Enhance acpi_ev_execute_reg_method() to" failed to apply to 4.5-stable tree
And promised you to perform the back porting.
After having it tested by LKP for several days, I sent it out to the stable mailing list.

I'm sorry I didn't send this email to you directly and didn't send it to the original mail thread for you to reference.
The original thread is:
Message-ID: <14603111697259@kroah.com>
Subject: FAILED: patch "[PATCH] ACPICA / Interpreter: Fix a regression triggered because of
 ACPICA: Events: Enhance acpi_ev_execute_reg_method() to" failed to apply to 4.5-stable tree

Hope you can help to have this shipped in 4.5-stable.

Thanks and best regards
-Lv


> 
> >
> > ---------------
> >
> > From: Lv Zheng <lv.zheng@intel.com>
> >
> > commit 5508df89756f8378024828e185724a9bd2348985 upstream.
> >
> > It is reported that the following commit triggers regressions:
> >  Linux commit: efaed9be998b5ae0afb7458e057e5f4402b43fa0
> >  ACPICA commit: 31178590dde82368fdb0f6b0e466b6c0add96c57
> >  Subject: ACPICA: Events: Enhance acpi_ev_execute_reg_method() to
> >           ensure no _REG evaluations can happen during OS early boot
> >           stages
> >
> > This is because that the ECDT support is not corrected in Linux, and Linux
> > requires to execute _REG for ECDT (though this sounds so wrong), we need to
> > ensure acpi_gbl_reg_methods_enabled is set before ECDT probing in order
> > for _REG to be executed. Since we have to move
> > "acpi_gbl_reg_methods_enabled = TRUE" to the initialization step
> > happening before ECDT probing, acpi_load_tables() is the best candidate for
> > now. Thus this patch fixes the regression by doing so.
> >
> > But if the ECDT support is fixed, Linux will not execute _REG for ECDT, and
> > ECDT probing will happen before acpi_load_tables(). At that time, we still
> > want to ensure acpi_gbl_reg_methods_enabled is set after executing
> > acpi_ns_initialize_objects() (under the condition of
> > acpi_gbl_group_module_level_code = FALSE), this patch also moves
> > acpi_ns_initialize_objects() to acpi_load_tables() accordingly.
> >
> > Since acpi_ns_initialize_objects() doesn't seem to be skippable, this
> > patch also removes ACPI_NO_OBJECT_INIT for the one invoked in
> > acpi_load_tables(). Reported by Chris Bainbridge, Fixed by Lv Zheng.
> >
> > Fixes: efaed9be998b (ACPICA: Events: Enhance
> acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen
> during OS early boot stages)
> > Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  drivers/acpi/acpica/nsinit.c   |    2 ++
> >  drivers/acpi/acpica/tbxfload.c |   14 ++++++++++++++
> >  drivers/acpi/acpica/utxfinit.c |   25 +++++++++++--------------
> >  3 files changed, 27 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
> > index bd75d46..ddb436f 100644
> > --- a/drivers/acpi/acpica/nsinit.c
> > +++ b/drivers/acpi/acpica/nsinit.c
> > @@ -83,6 +83,8 @@ acpi_status acpi_ns_initialize_objects(void)
> >
> >  	ACPI_FUNCTION_TRACE(ns_initialize_objects);
> >
> > +	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> > +			  "[Init] Completing Initialization of ACPI Objects\n"));
> >  	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
> >  			  "**** Starting initialization of namespace objects
> ****\n"));
> >  	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
> > diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
> > index 278666e..c37d479 100644
> > --- a/drivers/acpi/acpica/tbxfload.c
> > +++ b/drivers/acpi/acpica/tbxfload.c
> > @@ -83,6 +83,20 @@ acpi_status __init acpi_load_tables(void)
> >  				"While loading namespace from ACPI tables"));
> >  	}
> >
> > +	if (!acpi_gbl_group_module_level_code) {
> > +		/*
> > +		 * Initialize the objects that remain uninitialized. This
> > +		 * runs the executable AML that may be part of the
> > +		 * declaration of these objects:
> > +		 * operation_regions, buffer_fields, Buffers, and Packages.
> > +		 */
> > +		status = acpi_ns_initialize_objects();
> > +		if (ACPI_FAILURE(status)) {
> > +			return_ACPI_STATUS(status);
> > +		}
> > +	}
> > +
> > +	acpi_gbl_reg_methods_enabled = TRUE;
> >  	return_ACPI_STATUS(status);
> >  }
> >
> > diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
> > index 721b87c..638fbd4 100644
> > --- a/drivers/acpi/acpica/utxfinit.c
> > +++ b/drivers/acpi/acpica/utxfinit.c
> > @@ -267,7 +267,6 @@ acpi_status __init acpi_initialize_objects(u32 flags)
> >  	 * initialized, even if they contain executable AML (see the call to
> >  	 * acpi_ns_initialize_objects below).
> >  	 */
> > -	acpi_gbl_reg_methods_enabled = TRUE;
> >  	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
> >  		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> >  				  "[Init] Executing _REG OpRegion
> methods\n"));
> > @@ -299,20 +298,18 @@ acpi_status __init acpi_initialize_objects(u32 flags)
> >  	 */
> >  	if (acpi_gbl_group_module_level_code) {
> >  		acpi_ns_exec_module_code_list();
> > -	}
> >
> > -	/*
> > -	 * Initialize the objects that remain uninitialized. This runs the
> > -	 * executable AML that may be part of the declaration of these objects:
> > -	 * operation_regions, buffer_fields, Buffers, and Packages.
> > -	 */
> > -	if (!(flags & ACPI_NO_OBJECT_INIT)) {
> > -		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
> > -				  "[Init] Completing Initialization of ACPI
> Objects\n"));
> > -
> > -		status = acpi_ns_initialize_objects();
> > -		if (ACPI_FAILURE(status)) {
> > -			return_ACPI_STATUS(status);
> > +		/*
> > +		 * Initialize the objects that remain uninitialized. This
> > +		 * runs the executable AML that may be part of the
> > +		 * declaration of these objects:
> > +		 * operation_regions, buffer_fields, Buffers, and Packages.
> > +		 */
> > +		if (!(flags & ACPI_NO_OBJECT_INIT)) {
> > +			status = acpi_ns_initialize_objects();
> > +			if (ACPI_FAILURE(status)) {
> > +				return_ACPI_STATUS(status);
> > +			}
> >  		}
> >  	}
> >
> > --
> > 1.7.10
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe stable" 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] 5+ messages in thread

* Re: [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support
  2016-04-22  3:05   ` Zheng, Lv
@ 2016-04-22  3:14     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-04-22  3:14 UTC (permalink / raw)
  To: Zheng, Lv
  Cc: Wysocki, Rafael J, Rafael J. Wysocki, Brown, Len, Lv Zheng,
	stable@vger.kernel.org, linux-acpi@vger.kernel.org

On Fri, Apr 22, 2016 at 03:05:39AM +0000, Zheng, Lv wrote:
> Hi, Greg
> 
> > From: Greg KH [mailto:greg@kroah.com]
> > Subject: Re: [PATCH] ACPICA / Interpreter: Fix a regression triggered because
> > of wrong Linux ECDT support
> > 
> > On Wed, Apr 20, 2016 at 10:39:56AM +0800, Lv Zheng wrote:
> > > 4.5-stable review patch. If anyone has any objects, please let me know.
> > 
> > Huh?  I don't understand this email...
> > 
> > 
> [Lv Zheng] 
> 
> I received an error notice from you on 4/11/2016:
> FAILED: patch "[PATCH] ACPICA / Interpreter: Fix a regression triggered because of ACPICA: Events: Enhance acpi_ev_execute_reg_method() to" failed to apply to 4.5-stable tree
> And promised you to perform the back porting.
> After having it tested by LKP for several days, I sent it out to the stable mailing list.
> 
> I'm sorry I didn't send this email to you directly and didn't send it to the original mail thread for you to reference.
> The original thread is:
> Message-ID: <14603111697259@kroah.com>
> Subject: FAILED: patch "[PATCH] ACPICA / Interpreter: Fix a regression triggered because of
>  ACPICA: Events: Enhance acpi_ev_execute_reg_method() to" failed to apply to 4.5-stable tree
> 
> Hope you can help to have this shipped in 4.5-stable.

Yes, it's in my "to apply" queue, which is still not empty.  Don't
worry, it's not lost :)

thanks,

greg k-h

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

end of thread, other threads:[~2016-04-22  3:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20  2:39 [PATCH] ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support Lv Zheng
2016-04-20  5:58 ` Greg KH
2016-04-22  3:05   ` Zheng, Lv
2016-04-22  3:14     ` Greg KH
2016-04-20 10:27 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).