fix(ble/bluedroid): route ATT indication-conf timeout separately

(cherry picked from commit 6c3267ee84)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
Zhi Wei Jian
2026-07-14 12:04:07 +08:00
parent 12b6beff43
commit d2f755b735
2 changed files with 22 additions and 0 deletions

View File

@@ -317,6 +317,21 @@ static void btu_general_alarm_process(void *param)
TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)param;
assert(p_tle != NULL);
/* Skip stale alarms: btu_free_timer removes the entry before the owning
* structure may be freed, and btu_stop_timer clears in_use, but neither can
* retract a SIG_BTU_GENERAL_ALARM that was already queued to the BTU task. */
osi_mutex_lock(&btu_general_alarm_lock, OSI_MUTEX_MAX_TIMEOUT);
bool active = hash_map_has_key(btu_general_alarm_hash_map, p_tle);
osi_mutex_unlock(&btu_general_alarm_lock);
if (!active) {
osi_mutex_lock(&btu_oneshot_alarm_lock, OSI_MUTEX_MAX_TIMEOUT);
active = hash_map_has_key(btu_oneshot_alarm_hash_map, p_tle);
osi_mutex_unlock(&btu_oneshot_alarm_lock);
}
if (!active || p_tle->in_use == FALSE) {
return;
}
switch (p_tle->event) {
case BTU_TTYPE_BTM_DEV_CTL:
#if (CLASSIC_BT_INCLUDED == TRUE)
@@ -392,6 +407,12 @@ static void btu_general_alarm_process(void *param)
#endif // (GATTC_INCLUDED == TRUE)
break;
case BTU_TTYPE_ATT_WAIT_FOR_CONF:
#if (GATTS_INCLUDED == TRUE)
gatt_conf_timeout(p_tle);
#endif // (GATTS_INCLUDED == TRUE)
break;
#if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE)
case BTU_TTYPE_SMP_PAIRING_CMD:
smp_rsp_timeout(p_tle);

View File

@@ -174,6 +174,7 @@ typedef void (*tBTU_EVENT_CALLBACK)(BT_HDR *p_hdr);
/* L2CAP host-driven Create_Connection retry back-off timer */
#define BTU_TTYPE_L2CAP_LINK_RETRY 113
#define BTU_TTYPE_ATT_WAIT_FOR_CONF 114
/* BTU Task Signal */
typedef enum {