Skip to contentSkip to conversation

2.6.30-rc4 hid bluetooth not working

BUG Marc Pignat 3 participants 3 messages May 1, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore 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.

---

patch against 2.6.30-rc4.

net/bluetooth/hci_sysfs.c +0 -0
index b7c5108..42695e3 100644
@@ -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;

Acked-by
#1 lore raw
Quoted 7 lines · Marc Pignat

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.

FWIW.

Signature · 2 lines
Jiri Kosina
SUSE Labs
maintainer
#2 lore raw

Hi Jiri,

Quoted 11 lines
Quoted 7 lines

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.

FWIW.

nak from my side since I think it is the wrong fix. We really wanna wait for all works to finish here. This includes work from other connection attempts or terminations.

Regards

Marcel