From patchwork Thu Jun 15 01:41:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9787797 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 284D3602CB for ; Thu, 15 Jun 2017 01:41:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C40F20007 for ; Thu, 15 Jun 2017 01:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10C3028573; Thu, 15 Jun 2017 01:41:53 +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 8E4F220007 for ; Thu, 15 Jun 2017 01:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752036AbdFOBlp (ORCPT ); Wed, 14 Jun 2017 21:41:45 -0400 Received: from mga02.intel.com ([134.134.136.20]:51685 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbdFOBlp (ORCPT ); Wed, 14 Jun 2017 21:41:45 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2017 18:41:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,342,1493708400"; d="scan'208";a="98119032" Received: from unknown (HELO lvzheng-MOBLsp3.sh.intel.com) ([10.239.159.55]) by orsmga004.jf.intel.com with ESMTP; 14 Jun 2017 18:41:37 -0700 From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH v3 1/4] ACPI / EC: Enhance boot EC sanity check Date: Thu, 15 Jun 2017 09:41:35 +0800 Message-Id: <029653eabd94021790cf4fc5bca30b697920f7f4.1497490457.git.lv.zheng@intel.com> 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 It's reported that some buggy BIOS tables can contain 2 DSDT ECs, one of them is invalid but acpi_ec_dsdt_probe() fails to pick the valid one. This patch simply enhances sanity checks in ec_parse_device() as a workaround to skip probing wrong namespace ECs. Link: https://bugzilla.kernel.org/show_bug.cgi?id=195651 Tested-by: Daniel Drake Signed-off-by: Lv Zheng --- drivers/acpi/ec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index c24235d..c1f480b 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1362,6 +1362,8 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) ec_parse_io_ports, ec); if (ACPI_FAILURE(status)) return status; + if (ec->data_addr == 0 || ec->command_addr == 0) + return AE_OK; /* Get GPE bit assignment (EC events). */ /* TODO: Add support for _GPE returning a package */