aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-09-05 15:19:50 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:55 -0400
commitf3d82d0c8ec025fc113408e3ad5775fed5a060ff (patch)
tree9b436aa3ad6613171c0a9646188bc24587299980 /include/net/bluetooth
parent84bc0db53b3a425fb992d5fed25b575e4434167a (diff)
Bluetooth: Move identity address update behind a workqueue
The identity address update of all channels for an l2cap_conn needs to take the lock for each channel, i.e. it's safest to do this by a separate workqueue callback. Previously this was partially solved by moving the entire SMP key distribution behind a workqueue. However, if we want SMP context locking to be correct and safe we should always use the l2cap_chan lock when accessing it, meaning even smp_distribute_keys needs to take that lock which would once again create a dead lock when updating the identity address. The simplest way to solve this is to have l2cap_conn manage the deferred work which is what this patch does. A subsequent patch will remove the now unnecessary SMP key distribution work struct. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/l2cap.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index be25eddea615..ead99f032f7a 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -633,6 +633,8 @@ struct l2cap_conn {
633 struct sk_buff_head pending_rx; 633 struct sk_buff_head pending_rx;
634 struct work_struct pending_rx_work; 634 struct work_struct pending_rx_work;
635 635
636 struct work_struct id_addr_update_work;
637
636 __u8 disc_reason; 638 __u8 disc_reason;
637 639
638 struct l2cap_chan *smp; 640 struct l2cap_chan *smp;
@@ -937,7 +939,6 @@ int l2cap_ertm_init(struct l2cap_chan *chan);
937void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 939void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
938void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 940void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
939void l2cap_chan_del(struct l2cap_chan *chan, int err); 941void l2cap_chan_del(struct l2cap_chan *chan, int err);
940void l2cap_conn_update_id_addr(struct hci_conn *hcon);
941void l2cap_send_conn_req(struct l2cap_chan *chan); 942void l2cap_send_conn_req(struct l2cap_chan *chan);
942void l2cap_move_start(struct l2cap_chan *chan); 943void l2cap_move_start(struct l2cap_chan *chan);
943void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, 944void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,