History

ACPI / hotplug: Generate online uevents for ACPI containers

Commit 46394fd01 (ACPI / hotplug: Move container-specific code out of the core) removed the generation of "online" uevents for containers, because "add" uevents are now generated for them automatically when container system devices are registered. However, there are user space tools that need to be notified when the container and all of its children have been enumerated, which doesn't happen any more. For this reason, add a mechanism allowing "online" uevents to be generated for ACPI containers after enumerating the container along with all of its children.

Rafael J. Wysocki committed 12 years ago

Commit 8ab17fc1 parent 9e82bf03 files · +12 −0Browse files

Unified · Split

3 files
  1. drivers/acpi/container.c +8 −0
  2. drivers/acpi/scan.c +3 −0
  3. include/acpi/acpi_bus.h +1 −0
drivers/acpi/container.c+8−0
@@ -99,6 +99,13 @@ static void container_device_detach(struct acpi_device *adev) · 98 unmodified lines
9999 device_unregister(dev);
100100 }
101101
102+static void container_device_online(struct acpi_device *adev)
103+{
104+ struct device *dev = acpi_driver_data(adev);
105+
106+ kobject_uevent(&dev->kobj, KOBJ_ONLINE);
107+}
108+
102109 static struct acpi_scan_handler container_handler = {
103110 .ids = container_device_ids,
104111 .attach = container_device_attach,
@@ -106,6 +113,7 @@ static struct acpi_scan_handler container_handler = { · 1 unmodified line
106113 .hotplug = {
107114 .enabled = true,
108115 .demand_offline = true,
116+ .notify_online = container_device_online,
109117 },
110118 };
111119
drivers/acpi/scan.c+3−0
@@ -2189,6 +2189,9 @@ static void acpi_bus_attach(struct acpi_device *device) · 2188 unmodified lines
21892189 ok:
21902190 list_for_each_entry(child, &device->children, node)
21912191 acpi_bus_attach(child);
2192+
2193+ if (device->handler && device->handler->hotplug.notify_online)
2194+ device->handler->hotplug.notify_online(device);
21922195 }
21932196
21942197 /**
include/acpi/acpi_bus.h+1−0
@@ -118,6 +118,7 @@ struct acpi_device; · 117 unmodified lines
118118 struct acpi_hotplug_profile {
119119 struct kobject kobj;
120120 int (*scan_dependent)(struct acpi_device *adev);
121+ void (*notify_online)(struct acpi_device *adev);
121122 bool enabled:1;
122123 bool demand_offline:1;
123124 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t