]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Nov 2013 00:41:14 +0000 (01:41 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Nov 2013 00:41:14 +0000 (01:41 +0100)
commitcfcb00bef2e82d5091b19fdc9ef1751b32c086c7
tree4bf876eeb9adf2107f1c03178059bcd1676a9ee1
parent3e6a46ef6c1f2283b11fb0afeae4dcb6f87bb018
ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug

In theory, an ACPI device object may be the parent of another
device object whose hotplug is disabled by user space through its
scan handler.  In that case, the eject operation targeting the
parent should fail as though the parent's own hotplug was disabled,
but currently this is not the case, because acpi_scan_hot_remove()
doesn't check the disable/enable hotplug status of the children
of the top-most object passed to it.

To fix this, modify acpi_bus_offline_companions() to return an
error code if hotplug is disabled for the given device object.
[Also change the name of the function to acpi_bus_offline(),
because it is not only about companions any more, and change
the name of acpi_bus_online_companions() accordingly.]  Make
acpi_scan_hot_remove() propagate that error to its callers.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
drivers/acpi/scan.c