lkml.org 
[lkml]   [2009]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [BUG] 2.6.30-rc4 hid bluetooth not working
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 = container_of(work, struct hci_conn, work_add);

- /* ensure previous add/del is complete */
- flush_workqueue(bluetooth);
+ /* ensure previous del is complete */
+ flush_work(&conn->work_del);

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 = container_of(work, struct hci_conn, work_del);
struct hci_dev *hdev = conn->hdev;

- /* ensure previous add/del is complete */
- flush_workqueue(bluetooth);
+ /* ensure previous add is complete */
+ flush_work(&conn->work_add);

while (1) {
struct device *dev;


\
 
 \ /
  Last update: 2009-05-01 02:39    [W:0.104 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site