Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab56edf8 authored by Yeshwanth Sriram Guntuka's avatar Yeshwanth Sriram Guntuka Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: Increment htc runtime cnt prior to hif_send_head

HTC runtime count is incremented after posting the HTT
ver req message to CE4. There could be possibility of
processing the ver response message from FW even before
htc_runtime_cnt is incremented. This can casue RTPM put
to not happen causing imbalance in get/put count.

Fix is to increment htc_runtime_cnt before enqueuing
the HTT message to CE.

Change-Id: Ib9b69910cd14193c41ecfee804b390f8a6cdef49
CRs-Fixed: 2794451
parent a6c8f057
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3978,6 +3978,8 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
			 */
			if (htc_dec_return_runtime_cnt(soc->htc_soc) >= 0)
				htc_pm_runtime_put(soc->htc_soc);
			else
				soc->stats.htt_ver_req_put_skip++;
			soc->tgt_ver.major = HTT_VER_CONF_MAJOR_GET(*msg_word);
			soc->tgt_ver.minor = HTT_VER_CONF_MINOR_GET(*msg_word);
			QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_LOW,
+2 −0
Original line number Diff line number Diff line
@@ -177,6 +177,8 @@ struct htt_soc {
	struct {
		int htc_err_cnt;
		int htc_pkt_free;
		/* rtpm put skip count for ver req msg */
		int htt_ver_req_put_skip;
	} stats;

	HTT_TX_MUTEX_TYPE htt_tx_mutex;
+5 −4
Original line number Diff line number Diff line
@@ -851,8 +851,10 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target,
		if (pPacket->PktInfo.AsTx.Tag == HTC_TX_PACKET_TAG_RUNTIME_PUT)
			rt_put = true;
		else if (pPacket->PktInfo.AsTx.Tag ==
			 HTC_TX_PACKET_TAG_RTPM_PUT_RC)
			 HTC_TX_PACKET_TAG_RTPM_PUT_RC) {
			rt_put_in_resp = true;
			htc_inc_runtime_cnt(target);
		}

#if DEBUG_BUNDLE
		qdf_print(" Send single EP%d buffer size:0x%x, total:0x%x.",
@@ -872,6 +874,8 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target,
				       netbuf, data_attr);

		if (status != QDF_STATUS_SUCCESS) {
			if (rt_put_in_resp)
				htc_dec_return_runtime_cnt((void *)target);
			if (pEndpoint->EpCallBacks.ep_padding_credit_update) {
				if (used_extra_tx_credit) {
					ctx = pEndpoint->EpCallBacks.pContext;
@@ -930,9 +934,6 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target,
					   RTPM_ID_HTC);
			rt_put = false;
		}

		if (rt_put_in_resp)
			htc_inc_runtime_cnt(target);
	}
	if (qdf_unlikely(QDF_IS_STATUS_ERROR(status))) {
		AR_DEBUG_PRINTF(ATH_DEBUG_ERR,