Searched hist:"5 f4ce26078fde9cd406c008ba35e31bbb26a23a1" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/acpi/ |
H A D | scan.c | diff 5f4ce26078fde9cd406c008ba35e31bbb26a23a1 Thu Jun 17 08:57:07 CDT 2021 Rafael J. Wysocki <rafael.j.wysocki@intel.com> ACPI: scan: Fix race related to dropping dependencies
If acpi_add_single_object() runs concurrently with respect to acpi_scan_clear_dep() which deletes a dependencies list entry where the device being added is the consumer, the device's dep_unmet counter may not be updated to reflect that change.
Namely, if the dependencies list entry is deleted right after calling acpi_scan_dep_init() and before calling acpi_device_add(), acpi_scan_clear_dep() will not find the device object corresponding to the consumer device ACPI handle and it will not update its dep_unmet counter to reflect the deletion of the list entry. Consequently, the dep_unmet counter of the device will never become zero going forward which may prevent it from being completely enumerated.
To address this problem, modify acpi_add_single_object() to run acpi_tie_acpi_dev(), to attach the ACPI device object created by it to the corresponding ACPI namespace node, under acpi_dep_list_lock along with acpi_scan_dep_init() whenever the latter is called.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|