diff mbox series

[v1,2/2] ACPI: scan: Do not set type.bus_address if _HID is valid

Message ID 2223516.ElGaqSPkdT@kreacher (mailing list archive)
State Deferred, archived
Headers show
Series ACPI: scan: Honor certain device identification rules | expand

Commit Message

Rafael J. Wysocki Oct. 26, 2021, 7 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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 <rafael.j.wysocki@intel.com>
---
 drivers/acpi/scan.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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);