From: Rafael J. Wysocki Date: Fri, 17 Apr 2015 23:25:46 +0000 (+0200) Subject: ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline() X-Git-Tag: v3.19.7~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e361e9b2d54fa6cc78e1b79827f9be786a856d;p=thirdparty%2Fkernel%2Fstable.git ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline() commit 4c533c801d1c9b5c38458a0e7516e0cf50643782 upstream. acpi_scan_is_offline() may be called under the physical_node_lock lock of the given device object's parent, so prevent lockdep from complaining about that by annotating that instance with SINGLE_DEPTH_NESTING. Fixes: caa73ea158de (ACPI / hotplug / driver core: Handle containers in a special way) Reported-and-tested-by: Xie XiuQi Reviewed-by: Toshi Kani Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index dc4d8960684a7..6b69f7bf2500f 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -298,7 +298,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent) struct acpi_device_physical_node *pn; bool offline = true; - mutex_lock(&adev->physical_node_lock); + /* + * acpi_container_offline() calls this for all of the container's + * children under the container's physical_node_lock lock. + */ + mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING); list_for_each_entry(pn, &adev->physical_node_list, node) if (device_supports_offline(pn->dev) && !pn->dev->offline) {