[PATCH] acpi: check the online state of all children in container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just checking the state of container is not enough to confirm that
the whole container is offlined. Kernel should checks all children's
offline state as the logic in acpi_container_offline().

Cc: "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>
Cc: Len Brown <lenb@xxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxx>
Cc: Jiri Kosina <jkosina@xxxxxxx>
Signed-off-by: "Lee, Chun-Yi" <jlee@xxxxxxxx>
---
 drivers/acpi/scan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 1926918..f08ca31 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -260,13 +260,15 @@ static int acpi_scan_try_to_offline(struct acpi_device *device)
 static int acpi_scan_hot_remove(struct acpi_device *device)
 {
 	acpi_handle handle = device->handle;
+	struct acpi_device *child;
 	unsigned long long sta;
 	acpi_status status;
 
 	if (device->handler && device->handler->hotplug.demand_offline
 	    && !acpi_force_hot_remove) {
-		if (!acpi_scan_is_offline(device, true))
-			return -EBUSY;
+		list_for_each_entry(child, &device->children, node)
+			if (!acpi_scan_is_offline(child, false))
+				return -EBUSY;
 	} else {
 		int error = acpi_scan_try_to_offline(device);
 		if (error)
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux