Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2311444imm; Sat, 28 Jul 2018 14:08:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcyl0bvF1Ho0Mo8axsVfvG1fwcg7oS++FUK+90sZH8vxOO2UwE+2z9bsOTjjidL6suq3i9h X-Received: by 2002:a62:1089:: with SMTP id 9-v6mr11704209pfq.30.1532812106802; Sat, 28 Jul 2018 14:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532812106; cv=none; d=google.com; s=arc-20160816; b=0XfKIoIMzPtd0aBIV3b9wA5ZqMb7kP5JVbAVf1iynjR7b/wLZj1yYnYxDE12mNaStS xZpr4yXOQUvP3EwBxHGImdqtzUBKeNURP7HtsCvpBzmukZc2hW61WOfi0vCKOhRqZqo8 tVtVm0W26VcIfojx3kdpTb1hlj9/8XDNQGp8deepdc4BPFE+Al0GAhSr5pzT8jZ3DRqv iAfFwWyAGQL8+bAwqmh5hSoAHHSpJX4bLHqVuRIEb8GckL3L/DCweJALU5MJCrDK9bR7 ZVMPNVnXCEYyDkpnzLM7s03s9hPSaDoBtjl9FcId1ChWYgJCuUy5SKtWsP2/qL7k07+e qZig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eqz6KeJqJaTvI+dwMfdsUw6fwAsKa5DITxS9ICnr2Yc=; b=Bpiza8SR2HVM0DMjQaDF4dLJnAXyMAdxv/s5aglc1a6pXFDx22LoGEUt7RNUiAFK2m ET2/VZZfCqxwYpitkXhcVqrJApu4hrAQYCEo6uYR4S3HxidYjsmw9Pc2d528BdxBX+Dp HcNhzDKHL9RZVHRl3XLctM+R+jEbKb+uw/0LOpSxTH1oAhS3avE5T6ULS+ztt1/WwRjA IKSVfKoLFYH+xsUriSRapSxUooAIup+lc6oK4j88wNZnLu2Ll+Fh65dTsIyUmfeHBGR8 KvCYPqjPtb+xw+n1WwfEHcNTqccJd/1Lm9iosGSUvhK2rulLgxgbSEi1w0JCz7WPReaB 38TA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r192-v6si6826696pgr.17.2018.07.28.14.08.12; Sat, 28 Jul 2018 14:08:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730992AbeG1WfN (ORCPT + 99 others); Sat, 28 Jul 2018 18:35:13 -0400 Received: from mga05.intel.com ([192.55.52.43]:64574 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730941AbeG1WfN (ORCPT ); Sat, 28 Jul 2018 18:35:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jul 2018 14:07:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,415,1526367600"; d="scan'208";a="61514203" Received: from bartok.jf.intel.com ([10.54.75.128]) by orsmga006.jf.intel.com with ESMTP; 28 Jul 2018 14:07:25 -0700 From: Erik Schmauss To: linux-acpi@vger.kernel.org, rafael@kernel.org Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, oleksandr@natalenko.name, torvalds@linux-foundation.org, Erik Schmauss Subject: [PATCH] ACPICA: AML Parser: ignore control method status in module-level code Date: Sat, 28 Jul 2018 14:05:19 -0700 Message-Id: <20180728210519.20195-1-erik.schmauss@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Tested-by: Linus Torvalds Tested-by: Oleksandr Natalenko Signed-off-by: Erik Schmauss --- 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