qcacmn: Do RTPM put during cleanup when HTT ver resp is not received

For HTT h2t message which has a response from FW, runtime
get is done in HTC layer and the corresponding runtime_put
is done as part of the HTT response processing. In a scenario
where the HTT response is not received from FW or not processed
by host, runtime_put is not done as part of cleanup and panic
is triggered due to get/put imbalance.

Fix is to do RTPM put as part of htc cleanup when the HTT
response from FW is not received or processed.

Change-Id: I17ccb7c3e2293c95f5f233d36c6ef38a75733cce
CRs-Fixed: 2779113
This commit is contained in:
Yeshwanth Sriram Guntuka
2020-09-23 12:27:31 +05:30
committed by snandini
parent 3213f64df6
commit 478749a365
6 changed files with 84 additions and 3 deletions

View File

@@ -793,7 +793,7 @@ static int htt_h2t_ver_req_msg(struct htt_soc *soc)
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
dp_htt_h2t_send_complete_free_netbuf, qdf_nbuf_data(msg),
qdf_nbuf_len(msg), soc->htc_endpoint,
1); /* tag - not relevant here */
HTC_TX_PACKET_TAG_RTPM_PUT_RC);
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
status = DP_HTT_SEND_HTC_PKT(soc, pkt, HTT_H2T_MSG_TYPE_VERSION_REQ,
@@ -4562,7 +4562,15 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
case HTT_T2H_MSG_TYPE_VERSION_CONF:
{
htc_pm_runtime_put(soc->htc_soc);
/*
* HTC maintains runtime pm count for H2T messages that
* have a response msg from FW. This count ensures that
* in the case FW does not sent out the response or host
* did not process this indication runtime_put happens
* properly in the cleanup path.
*/
if (htc_dec_return_runtime_cnt(soc->htc_soc) >= 0)
htc_pm_runtime_put(soc->htc_soc);
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,