* Patch "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading ACPICA: Add per-table execution of module-level code" has been added to the 4.6-stable tree
@ 2016-07-25 1:01 gregkh
2016-07-25 1:23 ` Zheng, Lv
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2016-07-25 1:01 UTC (permalink / raw)
To: lv.zheng, gregkh, mika.westerberg, rafael.j.wysocki
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading
ACPICA: Add per-table execution of module-level code
to the 4.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
acpica-namespace-fix-deadlock-triggered-by-mlc-support-in-dynamic-table-loading.patch
and it can be found in the queue-4.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 2f38b1b16d9280689e5cfa47a4c50956bf437f0d Mon Sep 17 00:00:00 2001
From: Lv Zheng <lv.zheng@intel.com>
Date: Tue, 21 Jun 2016 12:34:15 +0800
Subject: ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading
From: Lv Zheng <lv.zheng@intel.com>
commit 2f38b1b16d9280689e5cfa47a4c50956bf437f0d upstream.
The new module-level code (MLC) approach invokes MLC on the per-table
basis, but the dynamic loading support of this is incorrect because
of the lock order:
acpi_ns_evaluate
acpi_ex_enter_intperter
acpi_ns_load_table (triggered by Load opcode)
acpi_ns_exec_module_code_list
acpi_ex_enter_intperter
The regression is introduced by the following commit:
Commit: 2785ce8d0da1cac9d8f78615e116cf929e9a9123
ACPICA Commit: 071eff738c59eda1792ac24b3b688b61691d7e7c
Subject: ACPICA: Add per-table execution of module-level code
This patch fixes this regression by unlocking the interpreter lock
before invoking MLC. However, the unlocking is done to the
acpi_ns_load_table(), in which the interpreter lock should be locked
by acpi_ns_parse_table() but it wasn't.
Fixes: 2785ce8d0da1 (ACPICA: Add per-table execution of module-level code)
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
[ rjw : Subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/acpica/exconfig.c | 2 ++
drivers/acpi/acpica/nsparse.c | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -108,7 +108,9 @@ acpi_ex_add_table(u32 table_index,
/* Add the table to the namespace */
+ acpi_ex_exit_interpreter();
status = acpi_ns_load_table(table_index, parent_node);
+ acpi_ex_enter_interpreter();
if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference(obj_desc);
*ddb_handle = NULL;
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -47,6 +47,7 @@
#include "acparser.h"
#include "acdispat.h"
#include "actables.h"
+#include "acinterp.h"
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsparse")
@@ -170,6 +171,8 @@ acpi_ns_parse_table(u32 table_index, str
ACPI_FUNCTION_TRACE(ns_parse_table);
+ acpi_ex_enter_interpreter();
+
/*
* AML Parse, pass 1
*
@@ -185,7 +188,7 @@ acpi_ns_parse_table(u32 table_index, str
status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
table_index, start_node);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto error_exit;
}
/*
@@ -201,8 +204,10 @@ acpi_ns_parse_table(u32 table_index, str
status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
table_index, start_node);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto error_exit;
}
+error_exit:
+ acpi_ex_exit_interpreter();
return_ACPI_STATUS(status);
}
Patches currently in stable-queue which might be from lv.zheng@intel.com are
queue-4.6/acpica-namespace-fix-deadlock-triggered-by-mlc-support-in-dynamic-table-loading.patch
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Patch "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading ACPICA: Add per-table execution of module-level code" has been added to the 4.6-stable tree
2016-07-25 1:01 Patch "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading ACPICA: Add per-table execution of module-level code" has been added to the 4.6-stable tree gregkh
@ 2016-07-25 1:23 ` Zheng, Lv
2016-07-25 4:14 ` gregkh
0 siblings, 1 reply; 3+ messages in thread
From: Zheng, Lv @ 2016-07-25 1:23 UTC (permalink / raw)
To: gregkh@linuxfoundation.org, mika.westerberg@linux.intel.com,
Wysocki, Rafael J
Cc: stable@vger.kernel.org, stable-commits@vger.kernel.org
Hi, Greg
> From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> Subject: Patch "ACPICA: Namespace: Fix deadlock triggered by MLC
> support in dynamic table loading ACPICA: Add per-table execution of
> module-level code" has been added to the 4.6-stable tree
>
>
> This is a note to let you know that I've just added the patch titled
>
> ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic
> table loading
> ACPICA: Add per-table execution of module-level code
[Lv Zheng]
The issue cannot be fixed by such a simple change.
It finally triggered many namespace locking issues in ACPICA and required big changes.
I'm waiting for ACPICA upstream's confirmation for another fix proposal.
And this fix is reverted from the Linux upstream during this period:
https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?id=ffd8d618
Here is the sotry for your reference:
https://bugzilla.kernel.org/show_bug.cgi?id=121701
Please do not make this commit a stable material.
Sorry for the problem.
Thanks and best regards
-Lv
>
> to the 4.6-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-
> queue.git;a=summary
>
> The filename of the patch is:
> acpica-namespace-fix-deadlock-triggered-by-mlc-support-in-dynamic-
> table-loading.patch
> and it can be found in the queue-4.6 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
> From 2f38b1b16d9280689e5cfa47a4c50956bf437f0d Mon Sep 17
> 00:00:00 2001
> From: Lv Zheng <lv.zheng@intel.com>
> Date: Tue, 21 Jun 2016 12:34:15 +0800
> Subject: ACPICA: Namespace: Fix deadlock triggered by MLC support in
> dynamic table loading
>
> From: Lv Zheng <lv.zheng@intel.com>
>
> commit 2f38b1b16d9280689e5cfa47a4c50956bf437f0d upstream.
>
> The new module-level code (MLC) approach invokes MLC on the per-table
> basis, but the dynamic loading support of this is incorrect because
> of the lock order:
>
> acpi_ns_evaluate
> acpi_ex_enter_intperter
> acpi_ns_load_table (triggered by Load opcode)
> acpi_ns_exec_module_code_list
> acpi_ex_enter_intperter
>
> The regression is introduced by the following commit:
>
> Commit: 2785ce8d0da1cac9d8f78615e116cf929e9a9123
> ACPICA Commit: 071eff738c59eda1792ac24b3b688b61691d7e7c
> Subject: ACPICA: Add per-table execution of module-level code
>
> This patch fixes this regression by unlocking the interpreter lock
> before invoking MLC. However, the unlocking is done to the
> acpi_ns_load_table(), in which the interpreter lock should be locked
> by acpi_ns_parse_table() but it wasn't.
>
> Fixes: 2785ce8d0da1 (ACPICA: Add per-table execution of module-level
> code)
> Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> [ rjw : Subject ]
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/acpi/acpica/exconfig.c | 2 ++
> drivers/acpi/acpica/nsparse.c | 9 +++++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> --- a/drivers/acpi/acpica/exconfig.c
> +++ b/drivers/acpi/acpica/exconfig.c
> @@ -108,7 +108,9 @@ acpi_ex_add_table(u32 table_index,
>
> /* Add the table to the namespace */
>
> + acpi_ex_exit_interpreter();
> status = acpi_ns_load_table(table_index, parent_node);
> + acpi_ex_enter_interpreter();
> if (ACPI_FAILURE(status)) {
> acpi_ut_remove_reference(obj_desc);
> *ddb_handle = NULL;
> --- a/drivers/acpi/acpica/nsparse.c
> +++ b/drivers/acpi/acpica/nsparse.c
> @@ -47,6 +47,7 @@
> #include "acparser.h"
> #include "acdispat.h"
> #include "actables.h"
> +#include "acinterp.h"
>
> #define _COMPONENT ACPI_NAMESPACE
> ACPI_MODULE_NAME("nsparse")
> @@ -170,6 +171,8 @@ acpi_ns_parse_table(u32 table_index, str
>
> ACPI_FUNCTION_TRACE(ns_parse_table);
>
> + acpi_ex_enter_interpreter();
> +
> /*
> * AML Parse, pass 1
> *
> @@ -185,7 +188,7 @@ acpi_ns_parse_table(u32 table_index, str
> status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
> table_index, start_node);
> if (ACPI_FAILURE(status)) {
> - return_ACPI_STATUS(status);
> + goto error_exit;
> }
>
> /*
> @@ -201,8 +204,10 @@ acpi_ns_parse_table(u32 table_index, str
> status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
> table_index, start_node);
> if (ACPI_FAILURE(status)) {
> - return_ACPI_STATUS(status);
> + goto error_exit;
> }
>
> +error_exit:
> + acpi_ex_exit_interpreter();
> return_ACPI_STATUS(status);
> }
>
>
> Patches currently in stable-queue which might be from lv.zheng@intel.com
> are
>
> queue-4.6/acpica-namespace-fix-deadlock-triggered-by-mlc-support-in-
> dynamic-table-loading.patch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patch "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading ACPICA: Add per-table execution of module-level code" has been added to the 4.6-stable tree
2016-07-25 1:23 ` Zheng, Lv
@ 2016-07-25 4:14 ` gregkh
0 siblings, 0 replies; 3+ messages in thread
From: gregkh @ 2016-07-25 4:14 UTC (permalink / raw)
To: Zheng, Lv
Cc: mika.westerberg@linux.intel.com, Wysocki, Rafael J,
stable@vger.kernel.org, stable-commits@vger.kernel.org
On Mon, Jul 25, 2016 at 01:23:05AM +0000, Zheng, Lv wrote:
> Hi, Greg
>
> > From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> > Subject: Patch "ACPICA: Namespace: Fix deadlock triggered by MLC
> > support in dynamic table loading ACPICA: Add per-table execution of
> > module-level code" has been added to the 4.6-stable tree
> >
> >
> > This is a note to let you know that I've just added the patch titled
> >
> > ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic
> > table loading
> > ACPICA: Add per-table execution of module-level code
> [Lv Zheng]
> The issue cannot be fixed by such a simple change.
> It finally triggered many namespace locking issues in ACPICA and required big changes.
> I'm waiting for ACPICA upstream's confirmation for another fix proposal.
> And this fix is reverted from the Linux upstream during this period:
> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?id=ffd8d618
>
> Here is the sotry for your reference:
> https://bugzilla.kernel.org/show_bug.cgi?id=121701
>
> Please do not make this commit a stable material.
> Sorry for the problem.
Thanks for letting me know, I've now dropped it from the tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-25 4:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 1:01 Patch "ACPICA: Namespace: Fix deadlock triggered by MLC support in dynamic table loading ACPICA: Add per-table execution of module-level code" has been added to the 4.6-stable tree gregkh
2016-07-25 1:23 ` Zheng, Lv
2016-07-25 4:14 ` gregkh
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).