qcacmn: Fix race condition in tx lookup queue during tx completion
Tx lookup queue holds the reference of the packet that is successfully transmitted via CE pipe. Tx lookup queue method can be called from tx path and from tasklet simultaneously for the same endpoint. One context can get the packet reference in its local lookup Queue and the other context may not find the reference as this is not brought back from lookupQueue to TxLookupQueue. Fix this by adding a per endpoint lookup queue lock. Change-Id: I0f4872f695e9ab15c27c91e733449f03871f4262 CRs-Fixed: 2047390
This commit is contained in:
11
htc/htc.c
11
htc/htc.c
@@ -142,7 +142,8 @@ void htc_dump(HTC_HANDLE HTCHandle, uint8_t CmdId, bool start)
|
||||
static void htc_cleanup(HTC_TARGET *target)
|
||||
{
|
||||
HTC_PACKET *pPacket;
|
||||
/* qdf_nbuf_t netbuf; */
|
||||
int i;
|
||||
HTC_ENDPOINT *endpoint;
|
||||
|
||||
if (target->hif_dev != NULL) {
|
||||
hif_detach_htc(target->hif_dev);
|
||||
@@ -180,6 +181,10 @@ static void htc_cleanup(HTC_TARGET *target)
|
||||
qdf_spinlock_destroy(&target->HTCRxLock);
|
||||
qdf_spinlock_destroy(&target->HTCTxLock);
|
||||
qdf_spinlock_destroy(&target->HTCCreditLock);
|
||||
for (i = 0; i < ENDPOINT_MAX; i++) {
|
||||
endpoint = &target->endpoint[i];
|
||||
qdf_spinlock_destroy(&endpoint->lookup_queue_lock);
|
||||
}
|
||||
|
||||
/* free our instance */
|
||||
qdf_mem_free(target);
|
||||
@@ -262,6 +267,10 @@ HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
|
||||
qdf_spinlock_create(&target->HTCRxLock);
|
||||
qdf_spinlock_create(&target->HTCTxLock);
|
||||
qdf_spinlock_create(&target->HTCCreditLock);
|
||||
for (i = 0; i < ENDPOINT_MAX; i++) {
|
||||
pEndpoint = &target->endpoint[i];
|
||||
qdf_spinlock_create(&pEndpoint->lookup_queue_lock);
|
||||
}
|
||||
target->is_nodrop_pkt = false;
|
||||
target->wmi_ep_count = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user