* [PATCH] ACPICA: AML Parser: ignore control method status in module-level code
@ 2018-07-28 21:05 Erik Schmauss
2018-07-29 10:25 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Erik Schmauss @ 2018-07-28 21:05 UTC (permalink / raw)
To: linux-acpi, rafael
Cc: gregkh, linux-kernel, oleksandr, torvalds, Erik Schmauss
Previous change in the AML parser code blindly set all non-successful
dispatcher statuses to AE_OK. This approach is incorrect because
successful control method invocations from module-level return
AE_CTRL_TRANSFER. Overwriting AE_OK to this status causes the AML
parser to think that there was no return value from the control
method invocation.
fixes: 73c2a01c52b6 (ACPICA: AML Parser: ignore dispatcher error status during table load)
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
---
drivers/acpi/acpica/psloop.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index ee840be150b5..44f35ab3347d 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -709,15 +709,20 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
} else
if ((walk_state->
parse_flags & ACPI_PARSE_MODULE_LEVEL)
+ && status != AE_CTRL_TRANSFER
&& ACPI_FAILURE(status)) {
/*
- * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by
- * executing it as a control method. However, if we encounter
- * an error while loading the table, we need to keep trying to
- * load the table rather than aborting the table load. Set the
- * status to AE_OK to proceed with the table load. If we get a
- * failure at this point, it means that the dispatcher got an
- * error while processing Op (most likely an AML operand error.
+ * ACPI_PARSE_MODULE_LEVEL flag means that we are currently
+ * loading a table by executing it as a control method.
+ * However, if we encounter an error while loading the table,
+ * we need to keep trying to load the table rather than
+ * aborting the table load (setting the status to AE_OK
+ * continues the table load). If we get a failure at this
+ * point, it means that the dispatcher got an error while
+ * processing Op (most likely an AML operand error) or a
+ * control method was called from module level and the
+ * dispatcher returned AE_CTRL_TRANSFER. In the latter case,
+ * leave the status alone, there's nothing wrong with it.
*/
status = AE_OK;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPICA: AML Parser: ignore control method status in module-level code
2018-07-28 21:05 [PATCH] ACPICA: AML Parser: ignore control method status in module-level code Erik Schmauss
@ 2018-07-29 10:25 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2018-07-29 10:25 UTC (permalink / raw)
To: Erik Schmauss
Cc: ACPI Devel Maling List, Rafael J. Wysocki, Greg Kroah-Hartman,
Linux Kernel Mailing List, oleksandr, Linus Torvalds
On Sat, Jul 28, 2018 at 11:05 PM, Erik Schmauss <erik.schmauss@intel.com> wrote:
> Previous change in the AML parser code blindly set all non-successful
> dispatcher statuses to AE_OK. This approach is incorrect because
> successful control method invocations from module-level return
> AE_CTRL_TRANSFER. Overwriting AE_OK to this status causes the AML
> parser to think that there was no return value from the control
> method invocation.
>
> fixes: 73c2a01c52b6 (ACPICA: AML Parser: ignore dispatcher error status during table load)
>
> Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
> Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
> ---
> drivers/acpi/acpica/psloop.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
> index ee840be150b5..44f35ab3347d 100644
> --- a/drivers/acpi/acpica/psloop.c
> +++ b/drivers/acpi/acpica/psloop.c
> @@ -709,15 +709,20 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
> } else
> if ((walk_state->
> parse_flags & ACPI_PARSE_MODULE_LEVEL)
> + && status != AE_CTRL_TRANSFER
> && ACPI_FAILURE(status)) {
> /*
> - * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by
> - * executing it as a control method. However, if we encounter
> - * an error while loading the table, we need to keep trying to
> - * load the table rather than aborting the table load. Set the
> - * status to AE_OK to proceed with the table load. If we get a
> - * failure at this point, it means that the dispatcher got an
> - * error while processing Op (most likely an AML operand error.
> + * ACPI_PARSE_MODULE_LEVEL flag means that we are currently
> + * loading a table by executing it as a control method.
> + * However, if we encounter an error while loading the table,
> + * we need to keep trying to load the table rather than
> + * aborting the table load (setting the status to AE_OK
> + * continues the table load). If we get a failure at this
> + * point, it means that the dispatcher got an error while
> + * processing Op (most likely an AML operand error) or a
> + * control method was called from module level and the
> + * dispatcher returned AE_CTRL_TRANSFER. In the latter case,
> + * leave the status alone, there's nothing wrong with it.
> */
> status = AE_OK;
> }
> --
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-29 10:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-28 21:05 [PATCH] ACPICA: AML Parser: ignore control method status in module-level code Erik Schmauss
2018-07-29 10:25 ` 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).