ACPI / scan: Avoid enumerating devices more than once

acpi_bus_attach() does not check the visited flag for devices that
have been enumerated already and some of them may be enumerated
for multiple times as a result, because some callers of
acpi_bus_scan() don't check the visited flag either.

For this reason, modify acpi_bus_attach() to check the visited flag
and avoid enumerating devices that have already been enumerated.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Joey Lee <jlee@suse.com>
This commit is contained in:
Rafael J. Wysocki 2017-04-17 01:20:48 +02:00
parent f5beabfe61
commit c381fc3a1b
1 changed files with 2 additions and 0 deletions

View File

@ -1840,6 +1840,8 @@ static void acpi_bus_attach(struct acpi_device *device)
device->flags.power_manageable = 0;
device->flags.initialized = true;
} else if (device->flags.visited) {
goto ok;
}
ret = acpi_scan_attach_handler(device);