Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp170970pxb; Wed, 27 Oct 2021 00:20:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyst3c8Jqka75tj3G3VE6YbRHMeK0wPwhz1YDnJpmSiTFLqCtZajgL+KHq8+9ZR3WrRymrh X-Received: by 2002:a17:90a:4fa1:: with SMTP id q30mr4022850pjh.12.1635319242171; Wed, 27 Oct 2021 00:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635319242; cv=none; d=google.com; s=arc-20160816; b=BzqDXBGxgweJBfu9fKHCpI2GM9lf8u0tDVjfKjM/D975Ue9uT9Nx9WQT9edTEbhYsC njVW0UcEH0bnf8B5gbC63iAQM4OZaS7+qSdgOHvQDUh/qc+sEcQ1VH3rxSQ4cB03y29/ mcAiNoaVI4Wt2EFg8cA9XVohH++mXoxN3Ghat6qvuwVLhAvw3Re3Ny27mZtAy3p2hKMj s66KF2CYloNqeh7Ef9dxGpcqQha2lD1Xhlwn/PEk9DQby1ehQ7vP44TS7cFWgTiL66A7 +CGiynPTXVXjEvIglIvMmqp0h6NiuWHF6ywwf2i/mkgHV2TV3UYd+Vfn5E46BMO9Pt1I UjGA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/3wX/P+f5Z9KXdLzAWVDVCtjGWL0W1L/dwQE9jsF+PA=; b=dSALgID2ccfFrMMeU0Mj+DoDt9yK9qksIgJvRTLluZS1GeLmk3xA0GUAhtzrRZ+cgG m8ViVkHz552aLNUdJeZf55dzRMQ4ZxeFlCFSgR+yB7bBofehf97TauchVOsz+1XZN14Q kFn9WmP62sSuaHMNcATfwXTAHYof0ONDOqR8I2LVJ2wArg7EleCYzeJc7V8rQtjU/YeI okzrkNVCbMlwtqLzJz5hON86/WM823zM786qWJRYb+I8wamYklGZTrPar0BeoI0FqBHo U8wxmVHMgQHNVZcrsQ5Cq6Hul9lDIbkAavvg7VSiVSWjJl9nmGXqC6+o4N56hNONFHwm yTYQ== 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 gn1si3774615pjb.169.2021.10.27.00.20.14; Wed, 27 Oct 2021 00:20:42 -0700 (PDT) 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 S238460AbhJZTDL (ORCPT + 99 others); Tue, 26 Oct 2021 15:03:11 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:48810 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbhJZTCs (ORCPT ); Tue, 26 Oct 2021 15:02:48 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 3.0.0) id db9042bec48cd122; Tue, 26 Oct 2021 21:00:18 +0200 Received: from kreacher.localnet (unknown [213.134.187.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id C30BF66A9F8; Tue, 26 Oct 2021 21:00:17 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Andy Shevchenko , Hans de Goede , LKML , Mika Westerberg Subject: [PATCH v1 1/2] ACPI: scan: Do not add device IDs from _CID if _HID is not valid Date: Tue, 26 Oct 2021 20:57:31 +0200 Message-ID: <5768704.lOV4Wx5bFT@kreacher> In-Reply-To: <11860508.O9o76ZdvQC@kreacher> References: <11860508.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.187.81 X-CLIENT-HOSTNAME: 213.134.187.81 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefkedguddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepteffueegudelgeeikeelffeftdettedvkedvtdeijeeuffegheevteduheejffeinecuffhomhgrihhnpehuvghfihdrohhrghenucfkphepvddufedrudefgedrudekjedrkedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekjedrkedupdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughrihihrdhshhgvvhgthhgvnhhkoheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehhuggvghhovgguvgesrhgvughhrghtrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhn vghlrdhorhhgpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Section 6.1.2 of ACPI 6.4 explicitly requires _HID to be present for _CID to be defined, so don't add device IDs from _CID to the device IDs list of a device if _HID is not valid. Link: https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuration.html#cid-compatible-id Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -1338,11 +1338,11 @@ static void acpi_set_pnp_ids(acpi_handle if (info->valid & ACPI_VALID_HID) { acpi_add_id(pnp, info->hardware_id.string); pnp->type.platform_id = 1; - } - if (info->valid & ACPI_VALID_CID) { - cid_list = &info->compatible_id_list; - for (i = 0; i < cid_list->count; i++) - acpi_add_id(pnp, cid_list->ids[i].string); + if (info->valid & ACPI_VALID_CID) { + cid_list = &info->compatible_id_list; + for (i = 0; i < cid_list->count; i++) + acpi_add_id(pnp, cid_list->ids[i].string); + } } if (info->valid & ACPI_VALID_ADR) { pnp->bus_address = info->address;