]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ACPI / hotplug: Generate online uevents for ACPI containers
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 21 Sep 2014 00:58:18 +0000 (02:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:16 +0000 (14:52 -0700)
commit 8ab17fc92e49bc2b8fff9d220c19bf50ec9c1158 upstream.

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>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/container.c
drivers/acpi/scan.c
include/acpi/acpi_bus.h

index 368f9ddb8480777420b2d5633facfeb238db1e27..e4a6f78f3bbcfe7b2841cbaf194bf65f2bef076e 100644 (file)
@@ -96,6 +96,13 @@ static void container_device_detach(struct acpi_device *adev)
                device_unregister(dev);
 }
 
+static void container_device_online(struct acpi_device *adev)
+{
+       struct device *dev = acpi_driver_data(adev);
+
+       kobject_uevent(&dev->kobj, KOBJ_ONLINE);
+}
+
 static struct acpi_scan_handler container_handler = {
        .ids = container_device_ids,
        .attach = container_device_attach,
@@ -103,6 +110,7 @@ static struct acpi_scan_handler container_handler = {
        .hotplug = {
                .enabled = true,
                .demand_offline = true,
+               .notify_online = container_device_online,
        },
 };
 
index 92d5184e36545c3cffaf3033570b8667dc2f210c..7103c7070568a7745c4c586886f41596a2625157 100644 (file)
@@ -2068,6 +2068,9 @@ static void acpi_bus_attach(struct acpi_device *device)
  ok:
        list_for_each_entry(child, &device->children, node)
                acpi_bus_attach(child);
+
+       if (device->handler && device->handler->hotplug.notify_online)
+               device->handler->hotplug.notify_online(device);
 }
 
 /**
index e9c4f190ffaeafd7c44cd7b9e67bcfd60e30dfd0..ac46782c10d38966afa0d82f2fe5ed403bd2d97a 100644 (file)
@@ -118,6 +118,7 @@ struct acpi_device;
 struct acpi_hotplug_profile {
        struct kobject kobj;
        int (*scan_dependent)(struct acpi_device *adev);
+       void (*notify_online)(struct acpi_device *adev);
        bool enabled:1;
        bool demand_offline:1;
 };