Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4381886ybf; Wed, 4 Mar 2020 02:54:10 -0800 (PST) X-Google-Smtp-Source: ADFU+vvqWwlQoHpiAlpwGIigfwgiteBQC+LHhm+nhjUK/KxFsMRFQf24wcvlYvpEXkFTyo+WZd9E X-Received: by 2002:a05:6830:1d69:: with SMTP id l9mr1856881oti.192.1583319249951; Wed, 04 Mar 2020 02:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583319249; cv=none; d=google.com; s=arc-20160816; b=uiAXqSG4/PEAChbeHhq7Lt+s9CX1Of9nZd0v5W2LgIdwLS7pJecH3EmTIBIRzJM6mu lhS7wHG4vO/xbCJiB+SgwMJloE5OcLUrXMNrFcViwK1khEW7d7S1OVCscGFfHqQTGmhG Fre+ISCb9cLWrO7CWXxOCsZm9BYlyIqPn05Dyd7XxUc7CoQ219fidD2S9/AzEjdVgjYa Fuge6lk8EJvia6j3AZ52JBcOxBa93LqtyLsluDuebz0nchdrELc9Q4st+WUIWcB2TtV9 Ly/NU70C95SOUF4gzjF9STkLtjG4Mudj1bp5PTdwwnbWWHhyE6Exnrza0TTapOT3G4qs ImsA== 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; bh=VLv4W3GyemhyMtofo82r2xCPwbn/32AIbSJyoFI0HCc=; b=qP4yrb/Kxo5UbHWC3BJws7L8HOnbxunseZWXi9cWYXeKqlkjBKwiHnbWvgF7uWD//Q 13Qozufm3XI9joDF7dNN4VUvPbKmDJRvjzaejJuoxVt8SVayjoFeEDnoaIeLBftQQS9x qSCLYJNylCYJR88XEcKGdrjwBXdlIt+dUGaP3X3IJuU1Nxc9i1R/CYSczEpevtGLN2yA f9pQkWEwytTGsjPv8xeajnrmufFTTLIoj+nGZXKz7UtMyeTC4S/PVjOt46hIFJ97+TBG n4t3QFB5CuWJHcDS0y1K76rPufOK9o6Squhkgum8QewYm9AmiaNvhHcW+MG+BA51LTz/ ZCZQ== 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 w21si959202otm.291.2020.03.04.02.53.58; Wed, 04 Mar 2020 02:54:09 -0800 (PST) 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 S2387807AbgCDKwz (ORCPT + 99 others); Wed, 4 Mar 2020 05:52:55 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:61848 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726583AbgCDKwz (ORCPT ); Wed, 4 Mar 2020 05:52:55 -0500 Received: from 79.184.237.41.ipv4.supernova.orange.pl (79.184.237.41) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id 75065426972dc4d4; Wed, 4 Mar 2020 11:52:53 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , "Rafael J. Wysocki" , Daniel Drake , Jian-Hong Pan Subject: [PATCH v2 5/6] ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC Date: Wed, 04 Mar 2020 11:49:14 +0100 Message-ID: <9601387.QWTSTiWaJV@kreacher> In-Reply-To: <2411774.6kdisLRoUK@kreacher> References: <2094703.CetWLLyMuz@kreacher> <2411774.6kdisLRoUK@kreacher> 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 From: "Rafael J. Wysocki" If the boot EC comes from the DSDT, its ACPI handle is equal to the handle of a device object with the PNP0C09 device ID. If that device object is passed to acpi_ec_add(), it is not necessary to allocate a new EC structure for it and parse it, because that has been done already, so change the function to use the fast path in that case. Signed-off-by: Rafael J. Wysocki --- -> v2: Reorder (previously [6/6]) and rebase. --- drivers/acpi/ec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 116163add41b..355d6973cb70 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1611,7 +1611,8 @@ static int acpi_ec_add(struct acpi_device *device) strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_EC_CLASS); - if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) { + if ((boot_ec && boot_ec->handle == device->handle) || + !strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) { /* Fast path: this device corresponds to the boot EC. */ ec = boot_ec; } else { -- 2.16.4