summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-09-05 21:19:50 +0200
committerMarcel Holtmann2014-09-08 19:07:55 +0200
commitf3d82d0c8ec025fc113408e3ad5775fed5a060ff (patch)
tree9b436aa3ad6613171c0a9646188bc24587299980 /net/bluetooth/smp.c
parentBluetooth: Don't take any action in smp_resume_cb if not encrypted (diff)
downloadkernel-qcow2-linux-f3d82d0c8ec025fc113408e3ad5775fed5a060ff.tar.gz
kernel-qcow2-linux-f3d82d0c8ec025fc113408e3ad5775fed5a060ff.tar.xz
kernel-qcow2-linux-f3d82d0c8ec025fc113408e3ad5775fed5a060ff.zip
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 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 9accb4739488..795c603bed30 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -654,7 +654,7 @@ static void smp_notify_keys(struct l2cap_conn *conn)
*/
bacpy(&hcon->dst, &smp->remote_irk->bdaddr);
hcon->dst_type = smp->remote_irk->addr_type;
- l2cap_conn_update_id_addr(hcon);
+ queue_work(hdev->workqueue, &conn->id_addr_update_work);
/* When receiving an indentity resolving key for
* a remote device that does not use a resolvable