Browse Source

qcacmn: Add TX credits after WMI logging

While processing a host-to-target credit report, the number of available
credits is incremented before recording the credit report event in the
WMI history log. This can lead to tricky debug scenarios where there is
an available credit, but the WMI history log does not show that a credit
report has been processed. In htc_process_credit_rpt, log the credit
report in the WMI history log before incrementing the available credits
field.

Change-Id: Id8632c85348bec38b6c46549a68f613d102b2ae5
CRs-Fixed: 2204248
Dustin Brown 7 years ago
parent
commit
f74576cb84
1 changed files with 4 additions and 2 deletions
  1. 4 2
      htc/htc_send.c

+ 4 - 2
htc/htc_send.c

@@ -2154,13 +2154,15 @@ void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt,
 
 #endif
 
-		pEndpoint->TxCredits += rpt_credits;
 		if (pEndpoint->service_id == WMI_CONTROL_SVC) {
 			htc_credit_record(HTC_PROCESS_CREDIT_REPORT,
-					  pEndpoint->TxCredits,
+					  pEndpoint->TxCredits + rpt_credits,
 					  HTC_PACKET_QUEUE_DEPTH(&pEndpoint->
 							TxQueue));
 		}
+
+		pEndpoint->TxCredits += rpt_credits;
+
 		if (pEndpoint->TxCredits
 		    && HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue)) {
 			UNLOCK_HTC_TX(target);