From patchwork Mon Jun 5 08:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9765873 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EA8F60364 for ; Mon, 5 Jun 2017 08:42:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D17227E5A for ; Mon, 5 Jun 2017 08:42:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11F2A27F86; Mon, 5 Jun 2017 08:42:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A949027E5A for ; Mon, 5 Jun 2017 08:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751494AbdFEIm0 (ORCPT ); Mon, 5 Jun 2017 04:42:26 -0400 Received: from mga11.intel.com ([192.55.52.93]:63046 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbdFEImZ (ORCPT ); Mon, 5 Jun 2017 04:42:25 -0400 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2017 01:42:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,300,1493708400"; d="scan'208";a="270265962" Received: from lvzheng-moblsp3.sh.intel.com ([10.239.159.181]) by fmsmga004.fm.intel.com with ESMTP; 05 Jun 2017 01:42:23 -0700 From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-acpi@vger.kernel.org, Bob Moore Subject: [PATCH 51/53] ACPICA: acpiexec: enhance local signal handler Date: Mon, 5 Jun 2017 16:42:23 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bob Moore ACPICA commit ffef4ae9a1b6032ebadeab2c2b806f0e585f0006 Add support for SIGSEGV Improve/cleanup SIGINT handling Link: https://github.com/acpica/acpica/commit/ffef4ae9 Signed-off-by: Bob Moore Signed-off-by: Lv Zheng --- drivers/acpi/acpica/dbexec.c | 12 ++++++++++++ drivers/acpi/acpica/dsmethod.c | 12 ++++++++---- drivers/acpi/acpica/psparse.c | 14 +++++++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c index b611cd9..3b30319 100644 --- a/drivers/acpi/acpica/dbexec.c +++ b/drivers/acpi/acpica/dbexec.c @@ -181,6 +181,18 @@ acpi_db_execute_method(struct acpi_db_method_info *info, acpi_gbl_method_executing = FALSE; if (ACPI_FAILURE(status)) { + if ((status == AE_ABORT_METHOD) || acpi_gbl_abort_method) { + + /* Clear the abort and fall back to the debugger prompt */ + + ACPI_EXCEPTION((AE_INFO, status, + "Aborting top-level method")); + + acpi_gbl_abort_method = FALSE; + status = AE_OK; + goto cleanup; + } + ACPI_EXCEPTION((AE_INFO, status, "while executing %s from debugger", info->pathname)); diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index 31c9c7a..d7fc369 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c @@ -212,6 +212,7 @@ acpi_status acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) { u32 aml_offset; + acpi_name name = 0; ACPI_FUNCTION_ENTRY(); @@ -237,10 +238,13 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) walk_state->parser_state. aml_start); - status = acpi_gbl_exception_handler(status, - walk_state->method_node ? - walk_state->method_node-> - name.integer : 0, + if (walk_state->method_node) { + name = walk_state->method_node->name.integer; + } else if (walk_state->deferred_node) { + name = walk_state->deferred_node->name.integer; + } + + status = acpi_gbl_exception_handler(status, name, walk_state->opcode, aml_offset, NULL); acpi_ex_enter_interpreter(); diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index 8116a67..ac88319 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c @@ -56,6 +56,7 @@ #include "acdispat.h" #include "amlcode.h" #include "acinterp.h" +#include "acnamesp.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME("psparse") @@ -538,9 +539,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) /* Either the method parse or actual execution failed */ acpi_ex_exit_interpreter(); - ACPI_ERROR_METHOD("Method parse/execution failed", - walk_state->method_node, NULL, - status); + if (status == AE_ABORT_METHOD) { + acpi_ns_print_node_pathname(walk_state-> + method_node, + "Method aborted:"); + acpi_os_printf("\n"); + } else { + ACPI_ERROR_METHOD + ("Method parse/execution failed", + walk_state->method_node, NULL, status); + } acpi_ex_enter_interpreter(); /* Check for possible multi-thread reentrancy problem */