Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1322236pxu; Sat, 5 Dec 2020 11:32:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUKL8HKNdJpGRmmNXRHcTRAkQWk7XhdszRCZQOQXgbuWIgXJQMRJTwNNWR2fycuN3X3dAC X-Received: by 2002:a05:6402:b4d:: with SMTP id bx13mr13314712edb.93.1607196753014; Sat, 05 Dec 2020 11:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607196753; cv=none; d=google.com; s=arc-20160816; b=Ad46FY4sZGutWmezpKi6J1pCJK19NLxykhJH+3DV5OyOXvFuOf/cs8sWXuBw91mVf+ Pcu5CGl6Q36N+L46fNvFaUczgP+aBp5Wx5SYkO7e52gt1VUY+s0RTFFh427OBX/3LWfA 4Hlkr5wq89vPld8w190jOXAkOpDR627O3KNZ0rKXwS6zEvgbh6FkYe0J50QikHutiQLk bIJCj8XvV43i0xZ3oGWyWPDc8YkQcS+lds8VcnqU8sRo7Ft/ipeko1sDCtKUD6Ykq/Y/ QyUf7XvbpKui6kJLnzqil6cKFE4vLPRXrHQQveabDNvYL8suNlppQ3Y6J9baxXUtSoTA KfdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=CgYwz/dc1kuk3JL453J6/XzGBL+yCdbIiXwzGt232+U=; b=J3xrJSg1Hsnfu2LOo2Z01jJbNVc8RAu4H9gQGrYqj8hHKSJxEh+Muw+uJD33FHwoYQ baim5+jFrb1DerSJ9O+gzeKddI0qBS6FpftyMBrEisW0fw/rNtUDp2QLiEdRjHteBKuQ erc2DGWDWZEqamOlqwO8Olvd9buiAeRkOmxrxifIW5gf+67yQXhwrL92Ym0qAlpvLfWJ wt5axalWuWXaonTlx3KrHKJBtweQ604LAU/DNZwE/aQekDSMMHlbW0O1ywaBvz70qgaN bIDgGliZAAF4BQA+pyIXJyV5kbTJoB61h22s55xQv+MbLXTWw+2j59s0rXgufaffPBV9 FUrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si4206270edj.176.2020.12.05.11.32.10; Sat, 05 Dec 2020 11:32:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726031AbgLETaZ (ORCPT + 99 others); Sat, 5 Dec 2020 14:30:25 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:44830 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgLETaY (ORCPT ); Sat, 5 Dec 2020 14:30:24 -0500 Received: from 89-77-60-66.dynamic.chello.pl (89.77.60.66) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.530) id 1acd33b1d947bb61; Sat, 5 Dec 2020 16:29:41 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Srinivas Pandruvada , Hans De Goede , Zhang Rui , David Box Subject: [PATCH] ACPI: scan: Add PNP0D80 to the _DEP exceptions list Date: Sat, 05 Dec 2020 16:29:41 +0100 Message-ID: <3849919.JfvvSOo2yN@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki The PNP0D80 ("Windows-compatible System Power Management Controller") device ID is used for identifying the special device object providing the LPI (Low-power S0 Idle) _DSM interface [1]. That device object does not supply any operation regions, but it appears in _DEP lists for other devices in the ACPI tables on some systems to enforce specific enumeration ordering that does not matter in Linux. For this reason, _DEP list entries pointing to the device object whose _CID returns PNP0D80 need not be taken into account as real operation region dependencies, so add that device ID to the list of device IDs for which the matching _DEP list entries should be ignored. Accordingly, update the function used for matching device IDs in that list to allow it to check _CID as well as _HID and rename it to acpi_info_matches_ids(). Link: https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf # [1] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -719,25 +719,40 @@ int acpi_device_add(struct acpi_device * /* -------------------------------------------------------------------------- Device Enumeration -------------------------------------------------------------------------- */ -static bool acpi_info_matches_hids(struct acpi_device_info *info, - const char * const hids[]) +static bool acpi_info_matches_ids(struct acpi_device_info *info, + const char * const ids[]) { + struct acpi_pnp_device_id_list *cid_list = NULL; int i; if (!(info->valid & ACPI_VALID_HID)) return false; - for (i = 0; hids[i]; i++) { - if (!strcmp(info->hardware_id.string, hids[i])) + if (info->valid & ACPI_VALID_CID) + cid_list = &info->compatible_id_list; + + for (i = 0; ids[i]; i++) { + int j; + + if (!strcmp(info->hardware_id.string, ids[i])) return true; + + if (!cid_list) + continue; + + for (j = 0; j < cid_list->count; j++) { + if (!strcmp(cid_list->ids[j].string, ids[i])) + return true; + } } return false; } /* List of HIDs for which we ignore matching ACPI devices, when checking _DEP lists. */ -static const char * const acpi_ignore_dep_hids[] = { +static const char * const acpi_ignore_dep_ids[] = { "INT3396", /* Windows System Power Management Controller */ + "PNP0D80", /* Windows-compatible System Power Management Controller */ NULL }; @@ -1857,7 +1872,7 @@ static void acpi_device_dep_initialize(s continue; } - skip = acpi_info_matches_hids(info, acpi_ignore_dep_hids); + skip = acpi_info_matches_ids(info, acpi_ignore_dep_ids); kfree(info); if (skip)