Skip to content

Commit 00e7362

Browse files
committed
Revert "Bluetooth: Fix deadlock with settings and bt_hci_cmd_send_sync()"
This reverts commit fb5e1de. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 3d9d248 commit 00e7362

File tree

5 files changed

+4
-26
lines changed

5 files changed

+4
-26
lines changed

subsys/bluetooth/host/id.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static void pending_id_update(struct bt_keys *keys, void *data)
866866
}
867867
}
868868

869-
void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag)
869+
static void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag)
870870
{
871871
atomic_set_bit(bt_dev.flags, BT_DEV_ID_PENDING);
872872
keys->state |= flag;

subsys/bluetooth/host/id.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8-
#include "keys.h"
9-
108
#define RPA_TIMEOUT_MS(_rpa_timeout) (_rpa_timeout * MSEC_PER_SEC)
119

1210
static inline bool bt_id_rpa_is_new(void)
@@ -46,6 +44,4 @@ int bt_id_set_private_addr(uint8_t id);
4644

4745
void bt_id_pending_keys_update(void);
4846

49-
void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag);
50-
5147
void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv);

subsys/bluetooth/host/keys.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "hci_core.h"
2929
#include "smp.h"
3030
#include "settings.h"
31-
#include "id.h"
3231
#include "keys.h"
3332

3433
#define LOG_LEVEL CONFIG_BT_KEYS_LOG_LEVEL
@@ -427,19 +426,11 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb,
427426
return 0;
428427
}
429428

430-
static void add_id_cb(struct k_work *work)
431-
{
432-
bt_id_pending_keys_update();
433-
}
434-
435-
static K_WORK_DEFINE(add_id_work, add_id_cb);
436-
437429
static void id_add(struct bt_keys *keys, void *user_data)
438430
{
439431
__ASSERT_NO_MSG(keys != NULL);
440432

441-
bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD);
442-
k_work_submit(&add_id_work);
433+
bt_id_add(keys);
443434
}
444435

445436
static int keys_commit(void)

tests/bluetooth/host/keys/mocks/id.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@
88
#include "mocks/id.h"
99

1010
DEFINE_FAKE_VOID_FUNC(bt_id_del, struct bt_keys *);
11-
DEFINE_FAKE_VOID_FUNC(bt_id_pending_keys_update);
12-
DEFINE_FAKE_VOID_FUNC(bt_id_pending_keys_update_set, struct bt_keys *, uint8_t);
13-
DEFINE_FAKE_VALUE_FUNC(int, k_work_submit, struct k_work *);

tests/bluetooth/host/keys/mocks/id.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@
1010
#include <host/keys.h>
1111

1212
/* List of fakes used by this unit tester */
13-
#define ID_FFF_FAKES_LIST(FAKE) \
14-
FAKE(bt_id_del) \
15-
FAKE(bt_id_pending_keys_update) \
16-
FAKE(bt_id_pending_keys_update_set) \
17-
FAKE(k_work_submit)
13+
#define ID_FFF_FAKES_LIST(FAKE) \
14+
FAKE(bt_id_del) \
1815

1916
DECLARE_FAKE_VOID_FUNC(bt_id_del, struct bt_keys *);
20-
DECLARE_FAKE_VOID_FUNC(bt_id_pending_keys_update);
21-
DECLARE_FAKE_VOID_FUNC(bt_id_pending_keys_update_set, struct bt_keys *, uint8_t);
22-
DECLARE_FAKE_VALUE_FUNC(int, k_work_submit, struct k_work *);

0 commit comments

Comments
 (0)