Skip to content

Commit 00dcf5d

Browse files
committed
Merge tag 'acpi-6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix the handling of dependencies between devices in the ACPI device enumeration code and address a _UID matching regression from the 6.8 development cycle. Specifics: - Modify the ACPI device enumeration code to avoid counting dependencies that have been met already as unmet (Hans de Goede) - Make _UID matching take the integer value of 0 into account as appropriate (Raag Jadav)" * tag 'acpi-6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: bus: allow _UID matching for integer zero ACPI: scan: Do not increase dep_unmet for already met dependencies
2 parents 136eb5f + d7da7e7 commit 00dcf5d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/acpi/scan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,8 @@ static void acpi_scan_dep_init(struct acpi_device *adev)
18431843
if (dep->honor_dep)
18441844
adev->flags.honor_deps = 1;
18451845

1846-
adev->dep_unmet++;
1846+
if (!dep->met)
1847+
adev->dep_unmet++;
18471848
}
18481849
}
18491850
}

include/acpi/acpi_bus.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,17 +911,19 @@ static inline bool acpi_int_uid_match(struct acpi_device *adev, u64 uid2)
911911
* acpi_dev_hid_uid_match - Match device by supplied HID and UID
912912
* @adev: ACPI device to match.
913913
* @hid2: Hardware ID of the device.
914-
* @uid2: Unique ID of the device, pass 0 or NULL to not check _UID.
914+
* @uid2: Unique ID of the device, pass NULL to not check _UID.
915915
*
916916
* Matches HID and UID in @adev with given @hid2 and @uid2. Absence of @uid2
917917
* will be treated as a match. If user wants to validate @uid2, it should be
918918
* done before calling this function.
919919
*
920-
* Returns: %true if matches or @uid2 is 0 or NULL, %false otherwise.
920+
* Returns: %true if matches or @uid2 is NULL, %false otherwise.
921921
*/
922922
#define acpi_dev_hid_uid_match(adev, hid2, uid2) \
923923
(acpi_dev_hid_match(adev, hid2) && \
924-
(!(uid2) || acpi_dev_uid_match(adev, uid2)))
924+
/* Distinguish integer 0 from NULL @uid2 */ \
925+
(_Generic(uid2, ACPI_STR_TYPES(!(uid2)), default: 0) || \
926+
acpi_dev_uid_match(adev, uid2)))
925927

926928
void acpi_dev_clear_dependencies(struct acpi_device *supplier);
927929
bool acpi_dev_ready_for_enumeration(const struct acpi_device *device);

0 commit comments

Comments
 (0)