From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Xie XiuQi <xiexiuqi@huawei.com>
Cc: lenb@kernel.org, guohanjun@huawei.com, hanjun.guo@linaro.org,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI / HOTPLUG: fix device->physical_node_lock deadlock
Date: Tue, 07 Apr 2015 13:50:48 +0200 [thread overview]
Message-ID: <12760195.2odgqTkKju@vostro.rjw.lan> (raw)
In-Reply-To: <5219717.RxvSXtBaZ8@vostro.rjw.lan>
On Tuesday, April 07, 2015 01:22:52 PM Rafael J. Wysocki wrote:
> On Tuesday, April 07, 2015 05:03:12 PM Xie XiuQi wrote:
> > I meet a deadlock during cpu hotplug. The code path is bellow:
> >
> > Call Trace:
> > [<ffffffff816e373c>] dump_stack+0x19/0x1b
> > [<ffffffff810fd85a>] validate_chain.isra.43+0xf4a/0x1120
> > [<ffffffff810236c9>] ? sched_clock+0x9/0x10
> > [<ffffffff810ca8bd>] ? sched_clock_local+0x1d/0x80
> > [<ffffffff810caa88>] ? sched_clock_cpu+0xa8/0x100
> > [<ffffffff810fe846>] __lock_acquire+0x3c6/0xb70
> > [<ffffffff810caa88>] ? sched_clock_cpu+0xa8/0x100
> > [<ffffffff810ff7e2>] lock_acquire+0xa2/0x1f0
> > [<ffffffff813ba132>] ? acpi_scan_is_offline+0x2c/0xa3
> > [<ffffffff816e7a14>] mutex_lock_nested+0x94/0x3f0
> > [<ffffffff813ba132>] ? acpi_scan_is_offline+0x2c/0xa3
> > [<ffffffff813ba132>] ? acpi_scan_is_offline+0x2c/0xa3
> > [<ffffffff810fe0fd>] ? trace_hardirqs_on+0xd/0x10
> > [<ffffffff813ba132>] acpi_scan_is_offline+0x2c/0xa3 --> LOCK (DEADLOCK)
>
> Is it the same device, actually? acpi_container_offline() walks the *children*
> of the container while acpi_bus_offline() locks the container itself.
So the patch below should make the splat go away too if I'm not mistaken.
---
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) {
next prev parent reply other threads:[~2015-04-07 11:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 9:03 Xie XiuQi
2015-04-07 11:22 ` Rafael J. Wysocki
2015-04-07 11:50 ` Rafael J. Wysocki [this message]
2015-04-10 23:31 ` [PATCH] ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline() Rafael J. Wysocki
2015-04-13 1:28 ` Xie XiuQi
2015-04-13 8:27 ` Hanjun Guo
2015-04-13 13:48 ` Rafael J. Wysocki
2015-04-16 19:01 ` Toshi Kani
2015-04-17 7:19 ` Xie XiuQi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12760195.2odgqTkKju@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=guohanjun@huawei.com \
--cc=hanjun.guo@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiexiuqi@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®