public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Young <hidave.darkstar@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Oliver Hartkopp <oliver@hartkopp.net>, linux-bluetooth@vger.kernel.org
Subject: Re: possible recursive locking in 2.6.30-rc6
Date: Wed, 27 May 2009 19:11:42 +0800	[thread overview]
Message-ID: <a8e1da0905270411p44f5aac2l572bd744f20244ca@mail.gmail.com> (raw)
In-Reply-To: <1243410155.20399.27.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

On Wed, May 27, 2009 at 3:42 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Dave,
>
>> Could you try the attached patch and report your result?
>
> please create patches with git-format-patch, because otherwise I have to
> do extra work to apply them.
>

Sorry about the inconvenience, actually I created the patch by quilt.

I just use git to monitor the latest kernel changes,  but do not use
it to create patches, I usually use a script of mine to create patch
manually.

Could you check the attached v2 patch? If it does not fit for
applying, I can start studying use git :)

> Regards
>
> Marcel
>
>
>



-- 
Regards
dave

[-- Attachment #2: bluetooth_flush_work_remove_v2.patch --]
[-- Type: application/octet-stream, Size: 2563 bytes --]

Lockdep warning reported by Oliver Hartkopp <oliver@hartkopp.net> 

=============================================
[ INFO: possible recursive locking detected ]
2.6.30-rc6-02911-gbb803cf #16
---------------------------------------------
bluetooth/2518 is trying to acquire lock:
 (bluetooth){+.+.+.}, at: [<c0130c14>] flush_work+0x28/0xb0

but task is already holding lock:
 (bluetooth){+.+.+.}, at: [<c0130424>] worker_thread+0x149/0x25e

other info that might help us debug this:
2 locks held by bluetooth/2518:
 #0:  (bluetooth){+.+.+.}, at: [<c0130424>] worker_thread+0x149/0x25e
 #1:  (&conn->work_del){+.+...}, at: [<c0130424>] worker_thread+0x149/0x25e

stack backtrace:
Pid: 2518, comm: bluetooth Not tainted 2.6.30-rc6-02911-gbb803cf #16
Call Trace:
 [<c03d64d9>] ? printk+0xf/0x11
 [<c0140d96>] __lock_acquire+0x7ce/0xb1b
 [<c0141173>] lock_acquire+0x90/0xad
 [<c0130c14>] ? flush_work+0x28/0xb0
 [<c0130c2e>] flush_work+0x42/0xb0
 [<c0130c14>] ? flush_work+0x28/0xb0
 [<f8b84966>] del_conn+0x1c/0x84 [bluetooth]
 [<c0130469>] worker_thread+0x18e/0x25e
 [<c0130424>] ? worker_thread+0x149/0x25e
 [<f8b8494a>] ? del_conn+0x0/0x84 [bluetooth]
 [<c0133843>] ? autoremove_wake_function+0x0/0x33
 [<c01302db>] ? worker_thread+0x0/0x25e
 [<c013355a>] kthread+0x45/0x6b
 [<c0133515>] ? kthread+0x0/0x6b
 [<c01034a7>] kernel_thread_helper+0x7/0x10

bluetoothd is a single thread workqueue, so work functions will execute in order.

Just remove the flush_work handling in hci_sysfs.c

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
Tested-by: Oliver Hartkopp <oliver@hartkopp.net>
---
net/bluetooth/hci_sysfs.c |    6 ------
1 file changed, 6 deletions(-)

diff -urpN a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
--- a/net/bluetooth/hci_sysfs.c	2009-05-27 19:00:12.000000000 +0800
+++ b/net/bluetooth/hci_sysfs.c	2009-05-27 19:00:25.000000000 +0800
@@ -90,9 +90,6 @@ static void add_conn(struct work_struct 
 	struct hci_conn *conn = container_of(work, struct hci_conn, work_add);
 	struct hci_dev *hdev = conn->hdev;
 
-	/* ensure previous del is complete */
-	flush_work(&conn->work_del);
-
 	dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
 
 	if (device_add(&conn->dev) < 0) {
@@ -118,9 +115,6 @@ static void del_conn(struct work_struct 
 	struct hci_conn *conn = container_of(work, struct hci_conn, work_del);
 	struct hci_dev *hdev = conn->hdev;
 
-	/* ensure previous add is complete */
-	flush_work(&conn->work_add);
-
 	if (!device_is_registered(&conn->dev))
 		return;
 

  reply	other threads:[~2009-05-27 11:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25 13:29 possible recursive locking in 2.6.30-rc6 Oliver Hartkopp
2009-05-25 19:55 ` Oliver Hartkopp
2009-05-26  8:19   ` Oliver Hartkopp
2009-05-27  1:13     ` Dave Young
2009-05-27  5:52       ` Oliver Hartkopp
2009-05-27  6:27         ` Marcel Holtmann
2009-05-27  7:42       ` Marcel Holtmann
2009-05-27 11:11         ` Dave Young [this message]
2009-05-27 11:17           ` Oliver Hartkopp
2009-05-28  0:42             ` Dave Young

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=a8e1da0905270411p44f5aac2l572bd744f20244ca@mail.gmail.com \
    --to=hidave.darkstar@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=oliver@hartkopp.net \
    /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