diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-09-05 15:19:50 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-09-08 13:07:55 -0400 |
commit | f3d82d0c8ec025fc113408e3ad5775fed5a060ff (patch) | |
tree | 9b436aa3ad6613171c0a9646188bc24587299980 /net/bluetooth/smp.c | |
parent | 84bc0db53b3a425fb992d5fed25b575e4434167a (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 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 2 |
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) | |||
654 | */ | 654 | */ |
655 | bacpy(&hcon->dst, &smp->remote_irk->bdaddr); | 655 | bacpy(&hcon->dst, &smp->remote_irk->bdaddr); |
656 | hcon->dst_type = smp->remote_irk->addr_type; | 656 | hcon->dst_type = smp->remote_irk->addr_type; |
657 | l2cap_conn_update_id_addr(hcon); | 657 | queue_work(hdev->workqueue, &conn->id_addr_update_work); |
658 | 658 | ||
659 | /* When receiving an indentity resolving key for | 659 | /* When receiving an indentity resolving key for |
660 | * a remote device that does not use a resolvable | 660 | * a remote device that does not use a resolvable |