qcacmn: dp: hl: Read tx resources after single thread check

Bus TX resources are being read before the single thread check.
If the thread is pre-empted, the tx_resource variable may not
match with actual TX resources.

Change-Id: I7e8af58a5702172a4cfbea9175f333aad4a57238
CRs-Fixed: 2459253
This commit is contained in:
Ajit Pal Singh
2019-06-04 13:24:57 +05:30
committed by nshrivas
父節點 94a976d817
當前提交 5c3ba8908f

查看文件

@@ -1139,14 +1139,6 @@ static enum HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
return result;
}
if (!IS_TX_CREDIT_FLOW_ENABLED(pEndpoint)) {
tx_resources =
hif_get_free_queue_number(target->hif_dev,
pEndpoint->UL_PipeID);
} else {
tx_resources = 0;
}
LOCK_HTC_TX(target);
if (!HTC_QUEUE_EMPTY(&sendQueue)) {
@@ -1185,6 +1177,14 @@ static enum HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
/* now drain the endpoint TX queue for transmission as long as we have
* enough transmit resources
*/
if (!IS_TX_CREDIT_FLOW_ENABLED(pEndpoint)) {
tx_resources =
hif_get_free_queue_number(target->hif_dev,
pEndpoint->UL_PipeID);
} else {
tx_resources = 0;
}
while (true) {
if (HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue) == 0)