Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'acpi-4.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
"These fix a recent ACPICA regression, fix a battery driver regression
introduced during the 4.17 cycle and fix up the recently added support
for the PPTT ACPI table.

Specifics:

- Revert part of a recent ACPICA regression fix that added leading
newlines to ACPICA error messages and made the kernel log look
broken (Rafael Wysocki).

- Fix an ACPI battery driver regression introduced during the 4.17
cycle due to incorrect error handling that made Thinkpad 13 laptops
crash on boot (Jouke Witteveen).

- Fix up the recently added PPTT ACPI table support by covering the
case when a PPTT structure represents a processors group correctly
(Sudeep Holla)"

* tag 'acpi-4.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / battery: Safe unregistering of hooks
ACPI / PPTT: use ACPI ID whenever ACPI_PPTT_ACPI_PROCESSOR_ID_VALID is set
ACPICA: Drop leading newlines from error messages

+16 -9
+3 -3
drivers/acpi/acpica/uterror.c
··· 182 182 switch (lookup_status) { 183 183 case AE_ALREADY_EXISTS: 184 184 185 - acpi_os_printf("\n" ACPI_MSG_BIOS_ERROR); 185 + acpi_os_printf(ACPI_MSG_BIOS_ERROR); 186 186 message = "Failure creating"; 187 187 break; 188 188 189 189 case AE_NOT_FOUND: 190 190 191 - acpi_os_printf("\n" ACPI_MSG_BIOS_ERROR); 191 + acpi_os_printf(ACPI_MSG_BIOS_ERROR); 192 192 message = "Could not resolve"; 193 193 break; 194 194 195 195 default: 196 196 197 - acpi_os_printf("\n" ACPI_MSG_ERROR); 197 + acpi_os_printf(ACPI_MSG_ERROR); 198 198 message = "Failure resolving"; 199 199 break; 200 200 }
+5 -4
drivers/acpi/battery.c
··· 717 717 */ 718 718 pr_err("extension failed to load: %s", hook->name); 719 719 __battery_hook_unregister(hook, 0); 720 - return; 720 + goto end; 721 721 } 722 722 } 723 723 pr_info("new extension: %s\n", hook->name); 724 + end: 724 725 mutex_unlock(&hook_mutex); 725 726 } 726 727 EXPORT_SYMBOL_GPL(battery_hook_register); ··· 733 732 */ 734 733 static void battery_hook_add_battery(struct acpi_battery *battery) 735 734 { 736 - struct acpi_battery_hook *hook_node; 735 + struct acpi_battery_hook *hook_node, *tmp; 737 736 738 737 mutex_lock(&hook_mutex); 739 738 INIT_LIST_HEAD(&battery->list); ··· 745 744 * when a battery gets hotplugged or initialized 746 745 * during the battery module initialization. 747 746 */ 748 - list_for_each_entry(hook_node, &battery_hook_list, list) { 747 + list_for_each_entry_safe(hook_node, tmp, &battery_hook_list, list) { 749 748 if (hook_node->add_battery(battery->bat)) { 750 749 /* 751 750 * The notification of the extensions has failed, to 752 751 * prevent further errors we will unload the extension. 753 752 */ 754 - __battery_hook_unregister(hook_node, 0); 755 753 pr_err("error in extension, unloading: %s", 756 754 hook_node->name); 755 + __battery_hook_unregister(hook_node, 0); 757 756 } 758 757 } 759 758 mutex_unlock(&hook_mutex);
+8 -2
drivers/acpi/pptt.c
··· 481 481 if (cpu_node) { 482 482 cpu_node = acpi_find_processor_package_id(table, cpu_node, 483 483 level, flag); 484 - /* Only the first level has a guaranteed id */ 485 - if (level == 0) 484 + /* 485 + * As per specification if the processor structure represents 486 + * an actual processor, then ACPI processor ID must be valid. 487 + * For processor containers ACPI_PPTT_ACPI_PROCESSOR_ID_VALID 488 + * should be set if the UID is valid 489 + */ 490 + if (level == 0 || 491 + cpu_node->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) 486 492 return cpu_node->acpi_processor_id; 487 493 return ACPI_PTR_DIFF(cpu_node, table); 488 494 }