Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1566325imm; Tue, 10 Jul 2018 04:15:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflK1fP0YN4DlT7a6chpFBtP9sP56Sg92B5h5trGyIPC9deQDG4JUtfvBMEVkfuFt7cL4b7 X-Received: by 2002:a17:902:8601:: with SMTP id f1-v6mr24148188plo.196.1531221353964; Tue, 10 Jul 2018 04:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531221353; cv=none; d=google.com; s=arc-20160816; b=jQYa2AEEUReg4FbpBCi7s/+YVAZOqu1f2WdXISVnxF4Hel+nliF3cjrmRfui/LLDVZ DyDhl6pC0hXiKWP12CDq2TJkzMkAnzZklXuFesJOTUwlVbi9dcXPOHmV1rRQBpZ/PJuJ sA34mQdpfJRf1p+PGKEOKjVSI3wWB8PTXXMjsHWkc6tlA7ynFqUEJWmVtoJ79ZuYBYEL p1xHLNK+1TjUjm4BJ/1RLAcxrgMMN5a55V7iAnweYCn8K6ahPI168kE0Lt/P15/XCmpV z8mDH7oM6ukz+w5EGL+Hat5XpFd5Rvv7uRzdgQJZE0aMgLzcob+JClrBnXf0WolLZems Jvrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2lCFOL5c6o2293BWxlDRvVZqXzDDOBqgZta87soYHJE=; b=KTfVbNRS90gRW82/HSI9/LLiq77cIIBoU3gc1ZY6KFxe/+ET+JCR8nNLWVU6c0qTL0 /DZRTNoLZGBPcVzBvix5eDvV5fYBvOOvUsxV2sJqJV4lNyjFP5Sj5i/crv5pqK2nT6an bk103acWVKPfp8UuNQ5Aki1axk6TiHvBmKwuDRf0XuY62xBChGmyaVyOTCpra5MEw2Ie La529jBwlxZDOIT5sstMQNmTZDARDxGRh+xeKyxpC88O65wPIC6p027tKG/7/lJTWBPn Rv8mPDk0c3w5JgAgNHkCyzLXpEDrS0kXKXWvWzV6gLmoAV//AZ60DN7CFNTYCAjtS++R GseA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si15694351pgi.456.2018.07.10.04.15.31; Tue, 10 Jul 2018 04:15:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933186AbeGJLOv (ORCPT + 99 others); Tue, 10 Jul 2018 07:14:51 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:50571 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbeGJLOt (ORCPT ); Tue, 10 Jul 2018 07:14:49 -0400 Received: from 79.184.255.246.ipv4.supernova.orange.pl (79.184.255.246) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 17ad5040c1ea7f31; Tue, 10 Jul 2018 13:14:47 +0200 From: "Rafael J. Wysocki" To: Jeremy Linton Cc: "Rafael J. Wysocki" , "Schmauss, Erik" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Lorenzo Pieralisi Subject: Re: 4.18rc3 TX2 boot failure with "ACPICA: AML parser: attempt to continue loading table after error" Date: Tue, 10 Jul 2018 13:13:17 +0200 Message-ID: <3574827.zOC4apc8e1@aspire.rjw.lan> In-Reply-To: <218e4339-477d-eb0d-6007-764c8e24229f@arm.com> References: <218e4339-477d-eb0d-6007-764c8e24229f@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, July 10, 2018 5:44:05 AM CEST Jeremy Linton wrote: > Hi, > > On 07/09/2018 04:28 PM, Rafael J. Wysocki wrote: > > On Mon, Jul 9, 2018 at 10:45 PM, Jeremy Linton wrote: > >> Hi, > >> > >> First thanks for the patch.. > >> > >> On 07/08/2018 04:14 AM, Rafael J. Wysocki wrote: > >>> > >>> On Monday, July 2, 2018 11:41:42 PM CEST Jeremy Linton wrote: > >>>> > >>>> Hi, > >>>> > >>>> I'm experiencing two problems with commit 5088814a6e931 which is > >>>> "ACPICA: AML parser: attempt to continue loading table after error" > >>>> > >>>> The first is this boot failure on a thunderX2: > >>>> > >>>> [ 10.770098] ACPI Error: Ignore error and continue table load > >> > >> > >> [trimming] > >> > >>>> ]--- > >>>> > >>>> Which does appear to be the result of some bad data in the table, but it > >>>> was working with 4.17, and reverting this commit solves the problem. > >>> > >>> > >>> Does the patch below make any difference? > >>> > >>> --- > >>> drivers/acpi/acpica/psobject.c | 3 +++ > >>> 1 file changed, 3 insertions(+) > >>> > >>> Index: linux-pm/drivers/acpi/acpica/psobject.c > >>> =================================================================== > >>> --- linux-pm.orig/drivers/acpi/acpica/psobject.c > >>> +++ linux-pm/drivers/acpi/acpica/psobject.c > >>> @@ -39,6 +39,9 @@ static acpi_status acpi_ps_get_aml_opcod > >>> ACPI_FUNCTION_TRACE_PTR(ps_get_aml_opcode, walk_state); > >>> walk_state->aml = walk_state->parser_state.aml; > >>> + if (!walk_state->aml) > >>> + return AE_CTRL_PARSE_CONTINUE; > >>> + > >> > >> > >> Well this seems to avoid the crash, but now it hangs right after on the > >> "Ignore error and continue table load" message. > > > > Well, maybe we should just abort in that case. > > > > I'm wondering what happens if you replace the return statement in the > > patch above with > > > > return_ACPI_STATUS(AE_AML_BAD_OPCODE) > > Yes, that is where I went when I applied the patch but I used > AE_CTRL_TERMINATE, which terminates the loop in acpi_ps_parse_loop() and > that appears to successfully finish/terminate the initial parsing pass. > But, it then crashes in acpi_ns_lookup called via the > acpi_walk_resources sequences that goes through ut_evalute_object() due > to the path/scope_info->scope.node being ACPI_ROOT_OBJECT (-1) and > bypassing the null check. Adding a ACPI_ROOT_OBJECT check as well as the > null checks in acpi_ns_lookup results in a successful boot. Tracking > down how the terminate (or whatever) is leaving the info->prefix_node > (in acpi_ns_evaluate) set to ROOT_OBJECT instead of null, is something I > don't yet understand. > > Anyway, I tried Using BAD_OPCODE rather than TERMINATE and it seems to > have the same basic result as PARSE_CONTINUE. OK, thanks! I evidently didn't look deep enough. Can you please check the patch below? I'm not sure if we can pass this broken state to acpi_ps_complete_final_op(), so it may be necessary to return an error directly when aml_op_start is NULL. --- drivers/acpi/acpica/psloop.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-pm/drivers/acpi/acpica/psloop.c =================================================================== --- linux-pm.orig/drivers/acpi/acpica/psloop.c +++ linux-pm/drivers/acpi/acpica/psloop.c @@ -493,6 +493,9 @@ acpi_status acpi_ps_parse_loop(struct ac ASL_CV_CAPTURE_COMMENTS(walk_state); aml_op_start = parser_state->aml; + if (!aml_op_start) + break; + if (!op) { status = acpi_ps_create_op(walk_state, aml_op_start, &op);