Commit 5396c935 authored by Dave Young's avatar Dave Young Committed by David S. Miller

[BLUETOOTH]: Fix bugs in previous conn add/del workqueue changes.

Jens Axboe noticed that we were queueing &conn->work on both btaddconn
and keventd_wq.
Signed-off-by: default avatarDave Young <hidave.darkstar@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30a50cc5
...@@ -282,6 +282,7 @@ static void add_conn(struct work_struct *work) ...@@ -282,6 +282,7 @@ static void add_conn(struct work_struct *work)
int i; int i;
flush_workqueue(btdelconn); flush_workqueue(btdelconn);
if (device_add(&conn->dev) < 0) { if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device"); BT_ERR("Failed to register connection device");
return; return;
...@@ -317,7 +318,6 @@ void hci_conn_add_sysfs(struct hci_conn *conn) ...@@ -317,7 +318,6 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
INIT_WORK(&conn->work, add_conn); INIT_WORK(&conn->work, add_conn);
queue_work(btaddconn, &conn->work); queue_work(btaddconn, &conn->work);
schedule_work(&conn->work);
} }
static int __match_tty(struct device *dev, void *data) static int __match_tty(struct device *dev, void *data)
...@@ -354,7 +354,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn) ...@@ -354,7 +354,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
INIT_WORK(&conn->work, del_conn); INIT_WORK(&conn->work, del_conn);
queue_work(btdelconn, &conn->work); queue_work(btdelconn, &conn->work);
schedule_work(&conn->work);
} }
int hci_register_sysfs(struct hci_dev *hdev) int hci_register_sysfs(struct hci_dev *hdev)
...@@ -408,6 +407,7 @@ int __init bt_sysfs_init(void) ...@@ -408,6 +407,7 @@ int __init bt_sysfs_init(void)
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
btdelconn = create_singlethread_workqueue("btdelconn"); btdelconn = create_singlethread_workqueue("btdelconn");
if (!btdelconn) { if (!btdelconn) {
err = -ENOMEM; err = -ENOMEM;
...@@ -447,8 +447,12 @@ int __init bt_sysfs_init(void) ...@@ -447,8 +447,12 @@ int __init bt_sysfs_init(void)
void bt_sysfs_cleanup(void) void bt_sysfs_cleanup(void)
{ {
destroy_workqueue(btaddconn); destroy_workqueue(btaddconn);
destroy_workqueue(btdelconn); destroy_workqueue(btdelconn);
class_destroy(bt_class); class_destroy(bt_class);
bus_unregister(&bt_bus); bus_unregister(&bt_bus);
platform_device_unregister(bt_platform); platform_device_unregister(bt_platform);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment