diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c index 59b0f06efa6c..cbfa4a7523d0 100644 --- a/core/dp/htt/htt_h2t.c +++ b/core/dp/htt/htt_h2t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -417,7 +417,7 @@ A_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev) cdf_nbuf_data(msg), cdf_nbuf_len(msg), pdev->htc_endpoint, - 1); /* tag - not relevant here */ + HTC_TX_PACKET_TAG_RUNTIME_PUT); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); @@ -439,6 +439,7 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev, struct htt_htc_pkt *pkt; cdf_nbuf_t msg; uint32_t *msg_word; + uint16_t htc_tag = 1; pkt = htt_htc_pkt_alloc(pdev); if (!pkt) @@ -452,6 +453,9 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev, return -EINVAL; /* failure */ } + if (stats_type_reset_mask) + htc_tag = HTC_TX_PACKET_TAG_RUNTIME_PUT; + /* show that this is not a tx frame download * (not required, but helpful) */ @@ -503,7 +507,7 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev, cdf_nbuf_data(msg), cdf_nbuf_len(msg), pdev->htc_endpoint, - 1); /* tag - not relevant here */ + htc_tag); /* tag - not relevant here */ SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); @@ -559,7 +563,7 @@ A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt) cdf_nbuf_data(msg), cdf_nbuf_len(msg), pdev->htc_endpoint, - 1); /* tag - not relevant here */ + HTC_TX_PACKET_TAG_RUNTIME_PUT); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); @@ -626,7 +630,7 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev, cdf_nbuf_data(msg), cdf_nbuf_len(msg), pdev->htc_endpoint, - 1); /* tag - not relevant here */ + HTC_TX_PACKET_TAG_RUNTIME_PUT); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); @@ -733,7 +737,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev) cdf_nbuf_data(msg), cdf_nbuf_len(msg), pdev->htc_endpoint, - 1); /* tag - not relevant here */ + HTC_TX_PACKET_TAG_RUNTIME_PUT); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index b4de1723a8f5..639c34506c8a 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -141,6 +141,7 @@ void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg) switch (msg_type) { case HTT_T2H_MSG_TYPE_VERSION_CONF: { + cdf_runtime_pm_put(); pdev->tgt_ver.major = HTT_VER_CONF_MAJOR_GET(*msg_word); pdev->tgt_ver.minor = HTT_VER_CONF_MINOR_GET(*msg_word); cdf_print @@ -287,6 +288,7 @@ void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg) ol_tx_single_completion_handler(pdev->txrx_pdev, compl_msg->status, compl_msg->desc_id); + cdf_runtime_pm_put(); HTT_TX_SCHED(pdev); } else { cdf_print("Ignoring HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND indication\n"); @@ -302,6 +304,7 @@ void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg) cookie |= ((uint64_t) (*(msg_word + 2))) << 32; stats_info_list = (uint8_t *) (msg_word + 3); + cdf_runtime_pm_put(); ol_txrx_fw_stats_handler(pdev->txrx_pdev, cookie, stats_info_list); break; @@ -357,6 +360,7 @@ void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg) uint8_t *op_msg_buffer; uint8_t *msg_start_ptr; + cdf_runtime_pm_put(); msg_start_ptr = (uint8_t *) msg_word; op_code = HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(*msg_word); diff --git a/core/htc/htc_packet.h b/core/htc/htc_packet.h index ea0d75f0cafb..ca3698f019b7 100644 --- a/core/htc/htc_packet.h +++ b/core/htc/htc_packet.h @@ -75,6 +75,10 @@ typedef struct _HTC_TX_PACKET_INFO { #define HTC_TX_PACKET_TAG_BUNDLED (HTC_TX_PACKET_TAG_USER_DEFINED + 1) #define HTC_TX_PACKET_TAG_AUTO_PM (HTC_TX_PACKET_TAG_USER_DEFINED + 2) +/* Tag packet for runtime put after sending */ +#define HTC_TX_PACKET_TAG_RUNTIME_PUT (HTC_TX_PACKET_TAG_USER_DEFINED + 3) + + #define HTC_TX_PACKET_FLAG_FIXUP_NETBUF (1 << 0) typedef struct _HTC_RX_PACKET_INFO { diff --git a/core/htc/htc_send.c b/core/htc/htc_send.c index 3b3d3c7265f9..26821fd542a4 100644 --- a/core/htc/htc_send.c +++ b/core/htc/htc_send.c @@ -577,6 +577,13 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target, break; } + /* + * For HTT messages without a response from fw, + * do the runtime put here. + * otherwise runtime put will be done when the fw response comes + */ + if (pPacket->PktInfo.AsTx.Tag == HTC_TX_PACKET_TAG_RUNTIME_PUT) + hif_pm_runtime_put(target->hif_dev); } if (cdf_unlikely(A_FAILED(status))) { #if defined(HIF_USB)