From: "Marc Pignat" <Marc.Pignat@hevs.ch>
To: <marcel@holtmann.org>,<jkosina@suse.cz>
Cc: <ext-roger.quadros@nokia.com>,<linux-bluetooth@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [BUG] 2.6.30-rc4 hid bluetooth not working
Date: Fri, 01 May 2009 02:37:00 +0200 [thread overview]
Message-ID: <49FA604C020000BF000290B6@mailgw2.hevs.ch> (raw)
Subject: bluetooth: Fix serialization when adding/deleting connections in =
hci_sysfs
add_conn and del_conn should be serialized, but flush_workqueue can't be =
used
by the worker thread on it's own queue, so use flush_work to serialize =
add_conn
and del_conn against each other.
Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
---
patch against 2.6.30-rc4.
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index b7c5108..42695e3 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -89,8 +89,8 @@ static void add_conn(struct work_struct *work)
{
struct hci_conn *conn =3D container_of(work, struct hci_conn, =
work_add);
=20
- /* ensure previous add/del is complete */
- flush_workqueue(bluetooth);
+ /* ensure previous del is complete */
+ flush_work(&conn->work_del);
=20
if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
@@ -134,8 +134,8 @@ static void del_conn(struct work_struct *work)
struct hci_conn *conn =3D container_of(work, struct hci_conn, =
work_del);
struct hci_dev *hdev =3D conn->hdev;
=20
- /* ensure previous add/del is complete */
- flush_workqueue(bluetooth);
+ /* ensure previous add is complete */
+ flush_work(&conn->work_add);
=20
while (1) {
struct device *dev;
next reply other threads:[~2009-05-01 0:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-01 0:37 Marc Pignat [this message]
2009-05-01 22:20 ` [BUG] 2.6.30-rc4 hid bluetooth not working Jiri Kosina
2009-05-01 22:56 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2009-05-03 14:55 Marc Pignat
2009-05-03 20:17 ` Marcel Holtmann
2009-05-03 21:18 ` Marc Pignat
2009-05-04 7:57 ` Roger Quadros
2009-05-02 8:45 Marc Pignat
2009-05-02 14:08 ` Dave Young
2009-05-02 19:42 ` Marcel Holtmann
2009-05-02 20:19 ` Justin Mattock
2009-05-02 20:21 ` Marcel Holtmann
2009-05-02 21:07 ` Justin P. Mattock
2009-05-02 21:14 ` Marcel Holtmann
2009-05-02 21:31 ` Justin P. Mattock
2009-05-02 17:03 ` Marcel Holtmann
2009-04-30 15:32 Marc Pignat
2009-04-30 14:49 Marc Pignat
2009-04-30 13:20 Marc Pignat
2009-04-30 13:57 ` Jiri Kosina
2009-04-30 15:03 ` Marcel Holtmann
2009-04-30 18:58 ` Jiri Kosina
2009-04-30 22:34 ` Marcel Holtmann
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=49FA604C020000BF000290B6@mailgw2.hevs.ch \
--to=marc.pignat@hevs.ch \
--cc=ext-roger.quadros@nokia.com \
--cc=jkosina@suse.cz \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
/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