From patchwork Tue Oct 26 19:00:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 12585553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00627C433F5 for ; Tue, 26 Oct 2021 19:00:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE6F460E09 for ; Tue, 26 Oct 2021 19:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238444AbhJZTCu (ORCPT ); Tue, 26 Oct 2021 15:02:50 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:60386 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238449AbhJZTCs (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 a2ba91e1d231c4e5; Tue, 26 Oct 2021 21:00:16 +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 7B54D66A9F8; Tue, 26 Oct 2021 21:00:15 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Andy Shevchenko , Hans de Goede , LKML , Mika Westerberg Subject: [PATCH v1 2/2] ACPI: scan: Do not set type.bus_address if _HID is valid Date: Tue, 26 Oct 2021 21:00:03 +0200 Message-ID: <2223516.ElGaqSPkdT@kreacher> In-Reply-To: <11860508.O9o76ZdvQC@kreacher> References: <11860508.O9o76ZdvQC@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.187.81 X-CLIENT-HOSTNAME: 213.134.187.81 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrudeljedgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeetffeugeduleegieeklefffedtteetvdekvddtieejueffgeehveetudehjeffieenucffohhmrghinhepuhgvfhhirdhorhhgnecukfhppedvudefrddufeegrddukeejrdekudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeejrdekuddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohephhguvghgohgvuggvsehrvgguhhgrthdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgv lhdrohhrghdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=10 Fuz1=10 Fuz2=10 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Rafael J. Wysocki According to Section 6.1 of ACPI 6.4, it is invalid to provide both _HID and _ADR for one device at the same time, so modify the code to set pnp.type.bus_address and pnp.bus_address for a device only if it has _ADR, but it doesn't have a valid _HID. Link: https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuration.html#device-identification-objects Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -1343,11 +1343,11 @@ static void acpi_set_pnp_ids(acpi_handle for (i = 0; i < cid_list->count; i++) acpi_add_id(pnp, cid_list->ids[i].string); } - } - if (info->valid & ACPI_VALID_ADR) { + } else if (info->valid & ACPI_VALID_ADR) { pnp->bus_address = info->address; pnp->type.bus_address = 1; } + if (info->valid & ACPI_VALID_UID) pnp->unique_id = kstrdup(info->unique_id.string, GFP_KERNEL);