aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-20 20:58:18 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-20 20:58:18 -0400
commit8ab17fc92e49bc2b8fff9d220c19bf50ec9c1158 (patch)
tree88ec833453a653ba4f5edee1aa8ec874615d8485
parent9e82bf014195d6f0054982c463575cdce24292be (diff)
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. Fixes: 46394fd01 (ACPI / hotplug: Move container-specific code out of the core) Reported-and-tested-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: 3.14+ <stable@vger.kernel.org> # 3.14+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/container.c8
-rw-r--r--drivers/acpi/scan.c3
-rw-r--r--include/acpi/acpi_bus.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 76f7cff64594..c8ead9f97375 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -99,6 +99,13 @@ static void container_device_detach(struct acpi_device *adev)
99 device_unregister(dev); 99 device_unregister(dev);
100} 100}
101 101
102static 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
102static struct acpi_scan_handler container_handler = { 109static struct acpi_scan_handler container_handler = {
103 .ids = container_device_ids, 110 .ids = container_device_ids,
104 .attach = container_device_attach, 111 .attach = container_device_attach,
@@ -106,6 +113,7 @@ static struct acpi_scan_handler container_handler = {
106 .hotplug = { 113 .hotplug = {
107 .enabled = true, 114 .enabled = true,
108 .demand_offline = true, 115 .demand_offline = true,
116 .notify_online = container_device_online,
109 }, 117 },
110}; 118};
111 119
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 3bf7764659a4..1c9a664c1705 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2189,6 +2189,9 @@ static void acpi_bus_attach(struct acpi_device *device)
2189 ok: 2189 ok:
2190 list_for_each_entry(child, &device->children, node) 2190 list_for_each_entry(child, &device->children, node)
2191 acpi_bus_attach(child); 2191 acpi_bus_attach(child);
2192
2193 if (device->handler && device->handler->hotplug.notify_online)
2194 device->handler->hotplug.notify_online(device);
2192} 2195}
2193 2196
2194/** 2197/**
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index c1c9de19edbe..2f98cf84368f 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -118,6 +118,7 @@ struct acpi_device;
118struct acpi_hotplug_profile { 118struct acpi_hotplug_profile {
119 struct kobject kobj; 119 struct kobject kobj;
120 int (*scan_dependent)(struct acpi_device *adev); 120 int (*scan_dependent)(struct acpi_device *adev);
121 void (*notify_online)(struct acpi_device *adev);
121 bool enabled:1; 122 bool enabled:1;
122 bool demand_offline:1; 123 bool demand_offline:1;
123}; 124};