aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-12-22 13:30:27 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-12-22 15:06:24 -0500
commitf20d09d5f7093e5dc5f231c65835e2d04739bd5e (patch)
tree846904ba60bf7af0b3bfb3663843b971f919e73f
parent460da45d92f19adda1b79910652d5a23c65dd272 (diff)
Bluetooth: remove *_bh usage from hci_dev_list and hci_cb_list
They don't need to disable interrupts anymore, we only run in process context now. Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r--include/net/bluetooth/hci_core.h16
-rw-r--r--net/bluetooth/hci_conn.c4
-rw-r--r--net/bluetooth/hci_core.c24
3 files changed, 22 insertions, 22 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 37d7cb8be480..5e2e98458496 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -801,13 +801,13 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
801 801
802 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; 802 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
803 803
804 read_lock_bh(&hci_cb_list_lock); 804 read_lock(&hci_cb_list_lock);
805 list_for_each(p, &hci_cb_list) { 805 list_for_each(p, &hci_cb_list) {
806 struct hci_cb *cb = list_entry(p, struct hci_cb, list); 806 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
807 if (cb->security_cfm) 807 if (cb->security_cfm)
808 cb->security_cfm(conn, status, encrypt); 808 cb->security_cfm(conn, status, encrypt);
809 } 809 }
810 read_unlock_bh(&hci_cb_list_lock); 810 read_unlock(&hci_cb_list_lock);
811} 811}
812 812
813static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, 813static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
@@ -823,26 +823,26 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
823 823
824 hci_proto_encrypt_cfm(conn, status, encrypt); 824 hci_proto_encrypt_cfm(conn, status, encrypt);
825 825
826 read_lock_bh(&hci_cb_list_lock); 826 read_lock(&hci_cb_list_lock);
827 list_for_each(p, &hci_cb_list) { 827 list_for_each(p, &hci_cb_list) {
828 struct hci_cb *cb = list_entry(p, struct hci_cb, list); 828 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
829 if (cb->security_cfm) 829 if (cb->security_cfm)
830 cb->security_cfm(conn, status, encrypt); 830 cb->security_cfm(conn, status, encrypt);
831 } 831 }
832 read_unlock_bh(&hci_cb_list_lock); 832 read_unlock(&hci_cb_list_lock);
833} 833}
834 834
835static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) 835static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
836{ 836{
837 struct list_head *p; 837 struct list_head *p;
838 838
839 read_lock_bh(&hci_cb_list_lock); 839 read_lock(&hci_cb_list_lock);
840 list_for_each(p, &hci_cb_list) { 840 list_for_each(p, &hci_cb_list) {
841 struct hci_cb *cb = list_entry(p, struct hci_cb, list); 841 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
842 if (cb->key_change_cfm) 842 if (cb->key_change_cfm)
843 cb->key_change_cfm(conn, status); 843 cb->key_change_cfm(conn, status);
844 } 844 }
845 read_unlock_bh(&hci_cb_list_lock); 845 read_unlock(&hci_cb_list_lock);
846} 846}
847 847
848static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, 848static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
@@ -850,13 +850,13 @@ static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
850{ 850{
851 struct list_head *p; 851 struct list_head *p;
852 852
853 read_lock_bh(&hci_cb_list_lock); 853 read_lock(&hci_cb_list_lock);
854 list_for_each(p, &hci_cb_list) { 854 list_for_each(p, &hci_cb_list) {
855 struct hci_cb *cb = list_entry(p, struct hci_cb, list); 855 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
856 if (cb->role_switch_cfm) 856 if (cb->role_switch_cfm)
857 cb->role_switch_cfm(conn, status, role); 857 cb->role_switch_cfm(conn, status, role);
858 } 858 }
859 read_unlock_bh(&hci_cb_list_lock); 859 read_unlock(&hci_cb_list_lock);
860} 860}
861 861
862int hci_register_cb(struct hci_cb *hcb); 862int hci_register_cb(struct hci_cb *hcb);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 401d8ea266aa..3db432473ad5 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -487,7 +487,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
487 487
488 BT_DBG("%s -> %s", batostr(src), batostr(dst)); 488 BT_DBG("%s -> %s", batostr(src), batostr(dst));
489 489
490 read_lock_bh(&hci_dev_list_lock); 490 read_lock(&hci_dev_list_lock);
491 491
492 list_for_each_entry(d, &hci_dev_list, list) { 492 list_for_each_entry(d, &hci_dev_list, list) {
493 if (!test_bit(HCI_UP, &d->flags) || test_bit(HCI_RAW, &d->flags)) 493 if (!test_bit(HCI_UP, &d->flags) || test_bit(HCI_RAW, &d->flags))
@@ -512,7 +512,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
512 if (hdev) 512 if (hdev)
513 hdev = hci_dev_hold(hdev); 513 hdev = hci_dev_hold(hdev);
514 514
515 read_unlock_bh(&hci_dev_list_lock); 515 read_unlock(&hci_dev_list_lock);
516 return hdev; 516 return hdev;
517} 517}
518EXPORT_SYMBOL(hci_get_route); 518EXPORT_SYMBOL(hci_get_route);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 22c8331cd0d5..4f0ff01dc680 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -844,7 +844,7 @@ int hci_get_dev_list(void __user *arg)
844 844
845 dr = dl->dev_req; 845 dr = dl->dev_req;
846 846
847 read_lock_bh(&hci_dev_list_lock); 847 read_lock(&hci_dev_list_lock);
848 list_for_each_entry(hdev, &hci_dev_list, list) { 848 list_for_each_entry(hdev, &hci_dev_list, list) {
849 if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->flags)) 849 if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->flags))
850 cancel_delayed_work(&hdev->power_off); 850 cancel_delayed_work(&hdev->power_off);
@@ -858,7 +858,7 @@ int hci_get_dev_list(void __user *arg)
858 if (++n >= dev_num) 858 if (++n >= dev_num)
859 break; 859 break;
860 } 860 }
861 read_unlock_bh(&hci_dev_list_lock); 861 read_unlock(&hci_dev_list_lock);
862 862
863 dl->dev_num = n; 863 dl->dev_num = n;
864 size = sizeof(*dl) + n * sizeof(*dr); 864 size = sizeof(*dl) + n * sizeof(*dr);
@@ -1458,7 +1458,7 @@ int hci_register_dev(struct hci_dev *hdev)
1458 */ 1458 */
1459 id = (hdev->dev_type == HCI_BREDR) ? 0 : 1; 1459 id = (hdev->dev_type == HCI_BREDR) ? 0 : 1;
1460 1460
1461 write_lock_bh(&hci_dev_list_lock); 1461 write_lock(&hci_dev_list_lock);
1462 1462
1463 /* Find first available device id */ 1463 /* Find first available device id */
1464 list_for_each(p, &hci_dev_list) { 1464 list_for_each(p, &hci_dev_list) {
@@ -1528,7 +1528,7 @@ int hci_register_dev(struct hci_dev *hdev)
1528 1528
1529 atomic_set(&hdev->promisc, 0); 1529 atomic_set(&hdev->promisc, 0);
1530 1530
1531 write_unlock_bh(&hci_dev_list_lock); 1531 write_unlock(&hci_dev_list_lock);
1532 1532
1533 hdev->workqueue = alloc_workqueue(hdev->name, WQ_HIGHPRI | WQ_UNBOUND | 1533 hdev->workqueue = alloc_workqueue(hdev->name, WQ_HIGHPRI | WQ_UNBOUND |
1534 WQ_MEM_RECLAIM, 1); 1534 WQ_MEM_RECLAIM, 1);
@@ -1561,9 +1561,9 @@ int hci_register_dev(struct hci_dev *hdev)
1561err_wqueue: 1561err_wqueue:
1562 destroy_workqueue(hdev->workqueue); 1562 destroy_workqueue(hdev->workqueue);
1563err: 1563err:
1564 write_lock_bh(&hci_dev_list_lock); 1564 write_lock(&hci_dev_list_lock);
1565 list_del(&hdev->list); 1565 list_del(&hdev->list);
1566 write_unlock_bh(&hci_dev_list_lock); 1566 write_unlock(&hci_dev_list_lock);
1567 1567
1568 return error; 1568 return error;
1569} 1569}
@@ -1576,9 +1576,9 @@ void hci_unregister_dev(struct hci_dev *hdev)
1576 1576
1577 BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); 1577 BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
1578 1578
1579 write_lock_bh(&hci_dev_list_lock); 1579 write_lock(&hci_dev_list_lock);
1580 list_del(&hdev->list); 1580 list_del(&hdev->list);
1581 write_unlock_bh(&hci_dev_list_lock); 1581 write_unlock(&hci_dev_list_lock);
1582 1582
1583 hci_dev_do_close(hdev); 1583 hci_dev_do_close(hdev);
1584 1584
@@ -1830,9 +1830,9 @@ int hci_register_cb(struct hci_cb *cb)
1830{ 1830{
1831 BT_DBG("%p name %s", cb, cb->name); 1831 BT_DBG("%p name %s", cb, cb->name);
1832 1832
1833 write_lock_bh(&hci_cb_list_lock); 1833 write_lock(&hci_cb_list_lock);
1834 list_add(&cb->list, &hci_cb_list); 1834 list_add(&cb->list, &hci_cb_list);
1835 write_unlock_bh(&hci_cb_list_lock); 1835 write_unlock(&hci_cb_list_lock);
1836 1836
1837 return 0; 1837 return 0;
1838} 1838}
@@ -1842,9 +1842,9 @@ int hci_unregister_cb(struct hci_cb *cb)
1842{ 1842{
1843 BT_DBG("%p name %s", cb, cb->name); 1843 BT_DBG("%p name %s", cb, cb->name);
1844 1844
1845 write_lock_bh(&hci_cb_list_lock); 1845 write_lock(&hci_cb_list_lock);
1846 list_del(&cb->list); 1846 list_del(&cb->list);
1847 write_unlock_bh(&hci_cb_list_lock); 1847 write_unlock(&hci_cb_list_lock);
1848 1848
1849 return 0; 1849 return 0;
1850} 1850}