ACPI / hotplug: Generate online uevents for ACPI containers
Commit46394fd01
(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>
This commit is contained in:
@@ -99,6 +99,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,
|
||||
@@ -106,6 +113,7 @@ static struct acpi_scan_handler container_handler = {
|
||||
.hotplug = {
|
||||
.enabled = true,
|
||||
.demand_offline = true,
|
||||
.notify_online = container_device_online,
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user