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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull ACPI fixes from Rafael Wysocki:
"These fix a memory management regression in ACPICA, repair an ACPI
blacklist entry damaged inadvertently during the 5.11 cycle and fix
the bookkeeping of devices with the same primary device ID in the ACPI
core.

Specifics:

- Make ACPICA use the same object cache consistently when allocating
and freeing objects (Vegard Nossum)

- Add a callback pointer removed inadvertently during the 5.11 cycle
to the ACPI backlight blacklist entry for Sony VPCEH3U1E (Chris
Chiu)

- Make the ACPI device enumeration core use IDA for creating names of
ACPI device objects with the same primary device ID to avoid using
duplicate device object names in some cases (Andy Shevchenko)"

* tag 'acpi-5.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPICA: Always create namespace nodes using acpi_ns_create_node()
ACPI: scan: Use unique number for instance_no
ACPI: video: Add missing callback back for Sony VPCEH3U1E

+36 -8
+1 -2
drivers/acpi/acpica/nsaccess.c
··· 99 99 * just create and link the new node(s) here. 100 100 */ 101 101 new_node = 102 - ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node)); 102 + acpi_ns_create_node(*ACPI_CAST_PTR(u32, init_val->name)); 103 103 if (!new_node) { 104 104 status = AE_NO_MEMORY; 105 105 goto unlock_and_exit; 106 106 } 107 107 108 - ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name); 109 108 new_node->descriptor_type = ACPI_DESC_TYPE_NAMED; 110 109 new_node->type = init_val->type; 111 110
+5 -1
drivers/acpi/internal.h
··· 9 9 #ifndef _ACPI_INTERNAL_H_ 10 10 #define _ACPI_INTERNAL_H_ 11 11 12 + #include <linux/idr.h> 13 + 12 14 #define PREFIX "ACPI: " 13 15 14 16 int early_acpi_osi_init(void); ··· 98 96 99 97 extern struct list_head acpi_bus_id_list; 100 98 99 + #define ACPI_MAX_DEVICE_INSTANCES 4096 100 + 101 101 struct acpi_device_bus_id { 102 102 const char *bus_id; 103 - unsigned int instance_no; 103 + struct ida instance_ida; 104 104 struct list_head node; 105 105 }; 106 106
+28 -5
drivers/acpi/scan.c
··· 479 479 list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) 480 480 if (!strcmp(acpi_device_bus_id->bus_id, 481 481 acpi_device_hid(device))) { 482 - if (acpi_device_bus_id->instance_no > 0) 483 - acpi_device_bus_id->instance_no--; 484 - else { 482 + ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no); 483 + if (ida_is_empty(&acpi_device_bus_id->instance_ida)) { 485 484 list_del(&acpi_device_bus_id->node); 486 485 kfree_const(acpi_device_bus_id->bus_id); 487 486 kfree(acpi_device_bus_id); ··· 630 631 return NULL; 631 632 } 632 633 634 + static int acpi_device_set_name(struct acpi_device *device, 635 + struct acpi_device_bus_id *acpi_device_bus_id) 636 + { 637 + struct ida *instance_ida = &acpi_device_bus_id->instance_ida; 638 + int result; 639 + 640 + result = ida_simple_get(instance_ida, 0, ACPI_MAX_DEVICE_INSTANCES, GFP_KERNEL); 641 + if (result < 0) 642 + return result; 643 + 644 + device->pnp.instance_no = result; 645 + dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, result); 646 + return 0; 647 + } 648 + 633 649 int acpi_device_add(struct acpi_device *device, 634 650 void (*release)(struct device *)) 635 651 { ··· 679 665 680 666 acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device)); 681 667 if (acpi_device_bus_id) { 682 - acpi_device_bus_id->instance_no++; 668 + result = acpi_device_set_name(device, acpi_device_bus_id); 669 + if (result) 670 + goto err_unlock; 683 671 } else { 684 672 acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), 685 673 GFP_KERNEL); ··· 697 681 goto err_unlock; 698 682 } 699 683 684 + ida_init(&acpi_device_bus_id->instance_ida); 685 + 686 + result = acpi_device_set_name(device, acpi_device_bus_id); 687 + if (result) { 688 + kfree(acpi_device_bus_id); 689 + goto err_unlock; 690 + } 691 + 700 692 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); 701 693 } 702 - dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); 703 694 704 695 if (device->parent) 705 696 list_add_tail(&device->node, &device->parent->children);
+1
drivers/acpi/video_detect.c
··· 147 147 }, 148 148 }, 149 149 { 150 + .callback = video_detect_force_vendor, 150 151 .ident = "Sony VPCEH3U1E", 151 152 .matches = { 152 153 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+1
include/acpi/acpi_bus.h
··· 233 233 234 234 struct acpi_device_pnp { 235 235 acpi_bus_id bus_id; /* Object name */ 236 + int instance_no; /* Instance number of this object */ 236 237 struct acpi_pnp_type type; /* ID type */ 237 238 acpi_bus_address bus_address; /* _ADR */ 238 239 char *unique_id; /* _UID */