lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <552B7DE4.3070008@linaro.org>
Date:	Mon, 13 Apr 2015 16:27:16 +0800
From:	Hanjun Guo <hanjun.guo@...aro.org>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>, linux-acpi@...r.kernel.org
CC:	Xie XiuQi <xiexiuqi@...wei.com>, guohanjun@...wei.com,
	linux-kernel@...r.kernel.org, Toshi Kani <toshi.kani@...com>
Subject: Re: [PATCH] ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline()

On 2015年04月11日 07:31, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> acpi_scan_is_offline() may be called under the physical_node_lock
> of the given device object's parent, so prevent lockdep from
> complaining about that by annotating that instance with
> SINGLE_DEPTH_NESTING.

I think this is trigged by setting acpi_force_hot_remove to 1,
in acpi_scan_hot_remove():

         if (device->handler && device->handler->hotplug.demand_offline
             && !acpi_force_hot_remove) {
                 if (!acpi_scan_is_offline(device, true))
                         return -EBUSY;
         } else {
                 int error = acpi_scan_try_to_offline(device);
                 if (error)
                         return error;
         }

then the container device will be removed by acpi_scan_try_to_offline(),
let's wait for Xiuqi's test result.

Thanks
Hanjun

>
> Reported-by: Xie XiuQi <xiexiuqi@...wei.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>   drivers/acpi/scan.c |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> Index: linux-pm/drivers/acpi/scan.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/scan.c
> +++ linux-pm/drivers/acpi/scan.c
> @@ -298,7 +298,11 @@ bool acpi_scan_is_offline(struct acpi_de
>   	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) {
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ