Received: by 10.213.65.68 with SMTP id h4csp2118797imn; Sun, 8 Apr 2018 20:10:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx48gTfMKUI3Mdqd+2dEIuZw0ZFHgP64crKQiWY+KiImf5ruHrtOFQOcUw3VjAhq9H3fx1DTS X-Received: by 10.101.102.211 with SMTP id c19mr13371420pgw.78.1523243321820; Sun, 08 Apr 2018 20:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243321; cv=none; d=google.com; s=arc-20160816; b=wBT5CiBEqJUppFNHeMjf48dniB27N6Z+GYAQ2Ok3nBHM6X54hKKtyenxZC2Yntigej wAGQKMSnhF7PPpOyw8UtBcGEkzXynDcCyu3gJgdTWu2CHEpjPJ450LhECb1MmF6ft3BH 6PO+WcAAw/P5IO2p3KyhRPPWmuHEZZMl/o6t+/xoPQpkoB8Uy/2ncL5XiR/hWIsdNgCV E/JG5SFpF2gwUo67kqR/3LvNKnm1uXuRpz0Xa/yRq8eIgfQg5nG5+toZXeRu7esPd0ii t7U4hLaNuwbXm7A0QSMZfY4B2rrYtsIrY2QkRcaXRXy5I6WGudnB2Mvs1BVr+bJTQjQD WAyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=b0YiT2T+FtLxzj6FY8UY5BYfCR7ObNbbB0WGW14ZOaE=; b=Qzn+lvBfWWxXFrQD8lV3OZ621toJasN9HyWuJOUgmXPJMs0mzGlQVGt3TPbsgI9ZQC SWSF3ZAXJ1LjXxtJz4hnJAfJuk9ftMnNnExoSX9jbdqdzpFbzZvsXST5RkHTIX6EJHWh uYPHBlaRUv3IUWDTimoQNDTFdj7BtYPeV5R/CPCey7jeO4MbYbP/2KOJQW/wliadsfoo kVxo4eiPOseBJY4PWVS3Rx1Nz6tHm/0OaNn5tIWcU0TFnoMNcmyF/N9eF+3jBUu+kiTG y6EXogTn7AcijA+uJK/8X9oRy9KXMNwKjJGOHgfo5kh2SdgMr+kAItbrokeQPhToiK7D sOrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=IngJYxMV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a62si4651144pgc.296.2018.04.08.20.08.04; Sun, 08 Apr 2018 20:08:41 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=IngJYxMV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757900AbeDICIp (ORCPT + 99 others); Sun, 8 Apr 2018 22:08:45 -0400 Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:54752 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756255AbeDIAbW (ORCPT ); Sun, 8 Apr 2018 20:31:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=b0YiT2T+FtLxzj6FY8UY5BYfCR7ObNbbB0WGW14ZOaE=; b=IngJYxMVeeDkwZaIDbXhP/aTX9lzZ2qnwnjOLd6LeHGpHM7vxhSxzs8P4+nGjmCR4QF10xv9LaxvjPxPbe+C542lQAa+WSCRUJMRjGXFAVT2RvWqoTnJnWfAMoIPuOFIXqojkrIrPzqU4EyXZknV2MXYwzitYX31B+A9pnyhaBI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0917.namprd21.prod.outlook.com (52.132.132.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:31:16 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:31:16 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Lv Zheng , "Rafael J . Wysocki" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 168/293] ACPI / EC: Add support to skip boot stage DSDT probe Thread-Topic: [PATCH AUTOSEL for 4.9 168/293] ACPI / EC: Add support to skip boot stage DSDT probe Thread-Index: AQHTz5k1HZKcGNrwkUGRd2s7f/GyaA== Date: Mon, 9 Apr 2018 00:25:05 +0000 Message-ID: <20180409002239.163177-168-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0917;7:Tdlq+MMmKcoyP1lLgd1cdApH+/TkrgDzAM2OkWpaQpGahQ5jUiO1XgRDng8iPQW8/O6VckK799j4RXjLFlFm4jRK6kjLGNAOL2n2hVGcGJvfyW6XTN/ktntuaFEj3RHJYJIkzcWWKZXUudrFDtDvXfmf6S3pJLjEMlwlU8B0s6bmIMj8eE/jslim3xPvfKDaN3EHjjQBHjg8XEKKAafDRgXkTgRdrAbMs0YF5s20TehtgWNXbjvQ8Utc//4Lk4sC;20:dttpZsJ68jKIRDTwN+tdYJy6lHdouD8Wh2sHxQ+rkatraBaNypSWHfQTm8yOnbS8XSm4GdYZHxp2fcW5SsXISTBOD0QhF+5wb4ZJmkq/h80TSDrgkPyOTkBAQPr7kjXxy1kS3UIc7FVcuci5CmIzAMZ9m65iAwbRefuJGJnkv2g= X-MS-Office365-Filtering-Correlation-Id: 73702c25-0e69-4897-e40c-08d59db134f6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0917; x-ms-traffictypediagnostic: DM5PR2101MB0917: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0917;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0917; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(54534003)(99286004)(22452003)(106356001)(26005)(110136005)(478600001)(54906003)(10290500003)(316002)(1076002)(72206003)(186003)(4326008)(97736004)(66066001)(11346002)(25786009)(86362001)(575784001)(476003)(446003)(2906002)(6666003)(6486002)(105586002)(86612001)(3280700002)(3660700001)(6512007)(3846002)(6306002)(6116002)(6436002)(2616005)(486006)(53936002)(7736002)(8676002)(81166006)(81156014)(8936002)(68736007)(305945005)(10090500001)(76176011)(6506007)(102836004)(36756003)(107886003)(59450400001)(2900100001)(2501003)(14454004)(966005)(5660300001)(5250100002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0917;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: yAXZt8AGtduX0HYRDtj1hFPCA35Z2r2aGKKeyniXooMG0mCljO4k/EKbN3DLE5+qFVNwnqKl4SmCjPwR2UPcT6muI93Ur6VHKOmVFX3AYKJmKVM8GGDv48Cw7AkREx+qG3eBBXlG6cvXNVUNwljxNDM/MKdbmYbnh7fb12X3D0UdKVYbtuOqJdCPWW+4345SS9Z/06ml58pIceMuq4omBbSmLXUhEuypxzHqANQrcDQxfgQ9YzeUGQHtKEJv4tIgeIhsG3OMCXmpxy7OLSCbDjQ/zRGh0janNHXybbspauz/hK/VRl6UOqIvXP8JVoDFL47L9HRoJ787EG3MXbi+LuwLG/sv8Q+ytijSbgmfTGl1NwH1rJQMm59Th3YPQ9xfRPI+x8VlCEdQO9uDWqlNtvRQA9ixtaC94KnMy2MgNXg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73702c25-0e69-4897-e40c-08d59db134f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:05.8626 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0917 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lv Zheng [ Upstream commit c712bb58d8278465b1a91f362a08f5c79ad077e4 ] We prepared _INI/_STA methods for \_SB, \_SB.PCI0, \_SB.LID0 and \_SB.EC, _HID(PNP0C09)/_CRS/_GPE for \_SB.EC to poke Windows behavior with qemu, we got the following execution sequence: \_SB._INI \_SB.PCI0._STA \_SB.LID0._STA \_SB.EC._STA \_SB.PCI0._INI \_SB.LID0._INI \_SB.EC._INI There is no extra DSDT EC device enumeration process occurring before the main ACPI device enumeration process. That means acpi_ec_dsdt_probe() is not Windows-compatible. Tracking back, it was added by the following commit: Commit: c5279dee26c0e8d7c4200993bfc4b540d2469598 Subject: ACPI: EC: Add some basic check for ECDT data but that commit was misguided. Why we shouldn't enumerate DSDT EC before the main ACPI device enumeration? The only way to know if the DSDT EC is valid would be to evaluate its _STA control method, but it's not safe to evaluate this control method that early and out of the ACPI enumeration process, because _STA may refer to entities (such as resources or ACPI device objects) that may not have been initialized before OSPM starts to enumerate them via the main ACPI device enumeration. But after we had reverted back to the expected behavior, a regression was reported. On that platform, there is no ECDT, but the platform control methods access EC operation region earlier than Linux expects causing some ACPI method execution errors. For this reason, we just go back to old behavior to still probe DSDT EC as the boot EC. However, that turns out to lead to yet another functional breakage and in order to work around all of the problems, we skip boot stage DSDT probe when the ECDT exists so that a later quirk can always use correct ECDT GPE setting. Link: http://bugzilla.kernel.org/show_bug.cgi?id=3D11880 Link: http://bugzilla.kernel.org/show_bug.cgi?id=3D119261 Link: http://bugzilla.kernel.org/show_bug.cgi?id=3D195651 Tested-by: Daniel Drake Signed-off-by: Lv Zheng [ rjw: Changelog & comments massage ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/ec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 217b0bac33d9..d4e8a17d939a 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1693,12 +1693,26 @@ static const struct acpi_device_id ec_device_ids[] = =3D { {"", 0}, }; =20 +/* + * This function is not Windows-compatible as Windows never enumerates the + * namespace EC before the main ACPI device enumeration process. It is + * retained for historical reason and will be deprecated in the future. + */ int __init acpi_ec_dsdt_probe(void) { acpi_status status; struct acpi_ec *ec; int ret; =20 + /* + * If a platform has ECDT, there is no need to proceed as the + * following probe is not a part of the ACPI device enumeration, + * executing _STA is not safe, and thus this probe may risk of + * picking up an invalid EC device. + */ + if (boot_ec) + return -ENODEV; + ec =3D acpi_ec_alloc(); if (!ec) return -ENOMEM; --=20 2.15.1