From: Rafael J. Wysocki Date: Wed, 29 Jan 2014 10:47:18 +0000 (+0100) Subject: Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' X-Git-Url: http://pileus.org/git/?p=~andy%2Flinux;a=commitdiff_plain;h=82e180598b54873553fb1d285fb0c90fc54f8f23 Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' * acpi-processor: ACPI / scan: reduce log level of "ACPI: \_PR_.CPU4: failed to get CPU APIC ID" ACPI / processor: Return specific error value when mapping lapic id * acpi-hotplug: ACPI / scan: Clear match_driver flag in acpi_bus_trim() * acpi-init: ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API * acpi-pm: ACPI / PM: Use ACPI_COMPANION() to get ACPI companions of devices * acpica: ACPICA: Remove bool usage from ACPICA. --- 82e180598b54873553fb1d285fb0c90fc54f8f23 diff --cc drivers/acpi/acpi_processor.c index c9311be29a6,21c0856daad,d58a2aba093,3c1d6b0c09a,3c1d6b0c09a,3c1d6b0c09a..c29c2c3ec0a --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@@@@@@ -258,21 -258,21 -258,18 -258,18 -258,18 -258,18 +258,21 @@@@@@@ static int acpi_processor_get_info(stru device_declaration = 1; pr->acpi_id = value; } ---- pr->apic_id = acpi_get_apicid(pr->handle, device_declaration, ---- pr->acpi_id); ---- cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id); ---- /* Handle UP system running SMP kernel, with no LAPIC in MADT */ ---- if (!cpu0_initialized && (cpu_index == -1) && ---- (num_online_cpus() == 1)) { ---- cpu_index = 0; ++++ apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id); ++++ if (apic_id < 0) { - acpi_handle_err(pr->handle, "failed to get CPU APIC ID.\n"); + ++++ acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n"); ++++ return -ENODEV; } ++++ pr->apic_id = apic_id; ---- cpu0_initialized = 1; ---- ++++ cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id); ++++ if (!cpu0_initialized) { ++++ cpu0_initialized = 1; ++++ /* Handle UP system running SMP kernel, with no LAPIC in MADT */ ++++ if ((cpu_index == -1) && (num_online_cpus() == 1)) ++++ cpu_index = 0; ++++ } pr->id = cpu_index; /* diff --cc drivers/acpi/scan.c index e00365ccb89,fd39459926b,089dc403c43,fd39459926b,fd39459926b,fd39459926b..7384158c7f8 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@@@@@@ -2097,29 -1954,22 -2036,30 -1954,22 -1954,22 -1954,22 +2097,30 @@@@@@@ EXPORT_SYMBOL(acpi_bus_scan) * * Must be called under acpi_scan_lock. */ - ---void acpi_bus_trim(struct acpi_device *start) + +++void acpi_bus_trim(struct acpi_device *adev) { + +++ struct acpi_scan_handler *handler = adev->handler; + +++ struct acpi_device *child; + +++ + +++ list_for_each_entry_reverse(child, &adev->children, node) + +++ acpi_bus_trim(child); + +++ ++ +++ adev->flags.match_driver = false; + +++ if (handler) { + +++ if (handler->detach) + +++ handler->detach(adev); + +++ + +++ adev->handler = NULL; + +++ } else { + +++ device_release_driver(&adev->dev); + +++ } /* - --- * Execute acpi_bus_device_detach() as a post-order callback to detach - --- * all ACPI drivers from the device nodes being removed. - --- */ - --- acpi_walk_namespace(ACPI_TYPE_ANY, start->handle, ACPI_UINT32_MAX, NULL, - --- acpi_bus_device_detach, NULL, NULL); - --- acpi_bus_device_detach(start->handle, 0, NULL, NULL); - --- /* - --- * Execute acpi_bus_remove() as a post-order callback to remove device - --- * nodes in the given namespace scope. + +++ * Most likely, the device is going away, so put it into D3cold before + +++ * that. */ - --- acpi_walk_namespace(ACPI_TYPE_ANY, start->handle, ACPI_UINT32_MAX, NULL, - --- acpi_bus_remove, NULL, NULL); - --- acpi_bus_remove(start->handle, 0, NULL, NULL); + +++ acpi_device_set_power(adev, ACPI_STATE_D3_COLD); + +++ adev->flags.initialized = false; + +++ adev->flags.visited = false; } EXPORT_SYMBOL_GPL(acpi_bus_trim);