mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lv Zheng <lv.zheng@intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>
Cc: Lv Zheng <lv.zheng@intel.com>, Lv Zheng <zetalog@gmail.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	Bob Moore <robert.moore@intel.com>
Subject: [PATCH 16/18] ACPICA: Fix a problem with recent extra support for control method invocations
Date: Wed, 28 Dec 2016 15:29:49 +0800	[thread overview]
Message-ID: <5391ee4cd79dd3eec90fbfc4cebe6297f84880ab.1482821486.git.lv.zheng@intel.com> (raw)
In-Reply-To: <cover.1482821486.git.lv.zheng@intel.com>

From: Bob Moore <robert.moore@intel.com>

ACPICA commit b7dae343fbb8c392999a66f5e08be5744a5d07e2

This change fixes a problem with the recent support that enables
control method invocations as Target operands to many ASL
operators. Eliminates errors similar to:

Needed type [Reference], found [Processor]

Link: https://github.com/acpica/acpica/commit/b7dae343
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/psargs.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 4e1065e..b0e55a7 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -269,6 +269,20 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 	 */
 	if (ACPI_SUCCESS(status) &&
 	    possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
+		if ((GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
+		     ARGP_SUPERNAME)
+		    || (GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
+			ARGP_TARGET)) {
+			/*
+			 * acpi_ps_get_next_namestring has increased the AML pointer past
+			 * the method invocation namestring, so we need to restore the
+			 * saved AML pointer back to the original method invocation
+			 * namestring.
+			 */
+			walk_state->parser_state.aml = start;
+			walk_state->arg_count = 1;
+			acpi_ps_init_op(arg, AML_INT_METHODCALL_OP);
+		}
 
 		/* This name is actually a control method invocation */
 
@@ -833,7 +847,10 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				  arg_type));
 
 		subop = acpi_ps_peek_opcode(parser_state);
-		if (subop == 0) {
+		if (subop == 0 ||
+		    acpi_ps_is_leading_char(subop) ||
+		    ACPI_IS_ROOT_PREFIX(subop) ||
+		    ACPI_IS_PARENT_PREFIX(subop)) {
 
 			/* NULL target (zero). Convert to a NULL namepath */
 
@@ -848,6 +865,12 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 			    acpi_ps_get_next_namepath(walk_state, parser_state,
 						      arg,
 						      ACPI_POSSIBLE_METHOD_CALL);
+
+			if (arg->common.aml_opcode == AML_INT_METHODCALL_OP) {
+				acpi_ps_free_op(arg);
+				arg = NULL;
+				walk_state->arg_count = 1;
+			}
 		} else {
 			/* Single complex argument, nothing returned */
 
-- 
2.7.4

  parent reply	other threads:[~2016-12-28  7:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28  7:28 [PATCH 00/18] ACPICA 20161222 Release Lv Zheng
2016-12-28  7:28 ` [PATCH 01/18] ACPICA: Debugger: Rename debugger OSL names Lv Zheng
2016-12-28  7:28 ` [PATCH 02/18] ACPICA: Hardware: Remove bit_offset masking support Lv Zheng
2016-12-28  7:28 ` [PATCH 03/18] ACPICA: Hardware: Add access_width/bit_offset support in acpi_hw_write() Lv Zheng
2016-12-28  7:28 ` [PATCH 04/18] ACPICA: Utilities: Add power of two rounding support Lv Zheng
2016-12-28  7:28 ` [PATCH 05/18] ACPICA: Hardware: Sort access bit width algorithm Lv Zheng
2016-12-28  7:28 ` [PATCH 06/18] ACPICA: Macro header: Fix some typos in comments. No functional change Lv Zheng
2016-12-28  7:28 ` [PATCH 07/18] ACPICA: Hardware: Add sleep register hooks Lv Zheng
2016-12-28  7:28 ` [PATCH 08/18] ACPICA: Linux-specific header: Add support for s390x compilation Lv Zheng
2016-12-28  7:29 ` [PATCH 09/18] ACPICA: MSVC: Fix MSVC6 build issues Lv Zheng
2016-12-28  7:29 ` [PATCH 10/18] ACPICA: EFI: Add efihello demo application Lv Zheng
2016-12-28  7:29 ` [PATCH 11/18] ACPICA: Disassembler: Add Switch/Case disassembly support Lv Zheng
2016-12-28  7:29 ` [PATCH 12/18] ACPICA: Utilities: Update debug output Lv Zheng
2016-12-28  7:29 ` [PATCH 13/18] ACPICA: Resources: Not a valid resource if buffer length too long Lv Zheng
2016-12-28  7:29 ` [PATCH 15/18] ACPICA: Parser: Allow method invocations as target operands Lv Zheng
2016-12-28  7:29 ` Lv Zheng [this message]
2016-12-28  7:29 ` [PATCH 17/18] ACPICA: Parser: Update parse info table for some operators Lv Zheng
2016-12-28  7:30 ` [PATCH 18/18] ACPICA: Update version to 20161222 Lv Zheng
2017-01-02 22:19 ` [PATCH 00/18] ACPICA 20161222 Release Rafael J. Wysocki
2017-01-03  5:23   ` Zheng, Lv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5391ee4cd79dd3eec90fbfc4cebe6297f84880ab.1482821486.git.lv.zheng@intel.com \
    --to=lv.zheng@intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    --cc=zetalog@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®