From f74576cb84479884d0dae9dd031e453f6f752848 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 12 Mar 2018 14:22:51 -0700 Subject: [PATCH] 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 --- htc/htc_send.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htc/htc_send.c b/htc/htc_send.c index 16ad4ac2935d..5a7db7114853 100644 --- a/htc/htc_send.c +++ b/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);