qcacmn: additional runtime PM stats for HTC layer

Add few more stats to the existing runtime PM stats for
HTC layer.

Change-Id: I1610acc534997b14ae070c48da03b4e07a00d9ef
CRs-Fixed: 2949969
This commit is contained in:
Manikanta Pubbisetty
2021-05-20 09:22:22 +05:30
committed by Madan Koyyalamudi
parent e5a60db99c
commit fe0463deb8
4 changed files with 51 additions and 3 deletions

View File

@@ -1110,6 +1110,14 @@ enum hif_pm_link_state {
with no response with no response
* HIF_PM_HTC_STATS_PUT_HTT_ERROR: PM stats for RTPM PUT for failed HTT packets * HIF_PM_HTC_STATS_PUT_HTT_ERROR: PM stats for RTPM PUT for failed HTT packets
* HIF_PM_HTC_STATS_PUT_HTC_CLEANUP: PM stats for RTPM PUT during HTC cleanup * HIF_PM_HTC_STATS_PUT_HTC_CLEANUP: PM stats for RTPM PUT during HTC cleanup
* HIF_PM_HTC_STATS_GET_HTC_KICK_QUEUES: PM stats for RTPM GET done during
* htc_kick_queues()
* HIF_PM_HTC_STATS_PUT_HTC_KICK_QUEUES: PM stats for RTPM PUT done during
* htc_kick_queues()
* HIF_PM_HTC_STATS_GET_HTT_FETCH_PKTS: PM stats for RTPM GET while fetching
* HTT packets from endpoint TX queue
* HIF_PM_HTC_STATS_PUT_HTT_FETCH_PKTS: PM stats for RTPM PUT while fetching
* HTT packets from endpoint TX queue
*/ */
enum hif_pm_htc_stats { enum hif_pm_htc_stats {
HIF_PM_HTC_STATS_GET_HTT_RESPONSE, HIF_PM_HTC_STATS_GET_HTT_RESPONSE,
@@ -1118,6 +1126,10 @@ enum hif_pm_htc_stats {
HIF_PM_HTC_STATS_PUT_HTT_NO_RESPONSE, HIF_PM_HTC_STATS_PUT_HTT_NO_RESPONSE,
HIF_PM_HTC_STATS_PUT_HTT_ERROR, HIF_PM_HTC_STATS_PUT_HTT_ERROR,
HIF_PM_HTC_STATS_PUT_HTC_CLEANUP, HIF_PM_HTC_STATS_PUT_HTC_CLEANUP,
HIF_PM_HTC_STATS_GET_HTC_KICK_QUEUES,
HIF_PM_HTC_STATS_PUT_HTC_KICK_QUEUES,
HIF_PM_HTC_STATS_GET_HTT_FETCH_PKTS,
HIF_PM_HTC_STATS_PUT_HTT_FETCH_PKTS,
}; };
#ifdef FEATURE_RUNTIME_PM #ifdef FEATURE_RUNTIME_PM

View File

@@ -1854,6 +1854,18 @@ void hif_pm_runtime_update_stats(struct hif_opaque_softc *hif_ctx,
case HIF_PM_HTC_STATS_PUT_HTC_CLEANUP: case HIF_PM_HTC_STATS_PUT_HTC_CLEANUP:
rpm_ctx->pm_stats.pm_stats_htc.rtpm_put_htc_cleanup++; rpm_ctx->pm_stats.pm_stats_htc.rtpm_put_htc_cleanup++;
break; break;
case HIF_PM_HTC_STATS_GET_HTC_KICK_QUEUES:
rpm_ctx->pm_stats.pm_stats_htc.rtpm_get_htc_kick_queues++;
break;
case HIF_PM_HTC_STATS_PUT_HTC_KICK_QUEUES:
rpm_ctx->pm_stats.pm_stats_htc.rtpm_put_htc_kick_queues++;
break;
case HIF_PM_HTC_STATS_GET_HTT_FETCH_PKTS:
rpm_ctx->pm_stats.pm_stats_htc.rtpm_get_htt_fetch_pkts++;
break;
case HIF_PM_HTC_STATS_PUT_HTT_FETCH_PKTS:
rpm_ctx->pm_stats.pm_stats_htc.rtpm_put_htt_fetch_pkts++;
break;
default: default:
break; break;
} }

View File

@@ -56,6 +56,10 @@ struct hif_pm_runtime_htc_stats {
uint32_t rtpm_put_htt_no_resp; uint32_t rtpm_put_htt_no_resp;
uint32_t rtpm_put_htt_error; uint32_t rtpm_put_htt_error;
uint32_t rtpm_put_htc_cleanup; uint32_t rtpm_put_htc_cleanup;
uint32_t rtpm_get_htc_kick_queues;
uint32_t rtpm_put_htc_kick_queues;
uint32_t rtpm_get_htt_fetch_pkts;
uint32_t rtpm_put_htt_fetch_pkts;
}; };
/* Debugging stats for Runtime PM */ /* Debugging stats for Runtime PM */

View File

@@ -1340,19 +1340,30 @@ static void get_htc_send_packets(HTC_TARGET *target,
} }
break; break;
} }
hif_pm_runtime_update_stats(
target->hif_dev, rtpm_dbgid,
HIF_PM_HTC_STATS_GET_HTT_FETCH_PKTS);
} }
ret = hif_system_pm_state_check(target->hif_dev); ret = hif_system_pm_state_check(target->hif_dev);
if (ret) { if (ret) {
if (do_pm_get) if (do_pm_get) {
hif_pm_runtime_put(target->hif_dev, rtpm_dbgid); hif_pm_runtime_put(target->hif_dev, rtpm_dbgid);
hif_pm_runtime_update_stats(
target->hif_dev, rtpm_dbgid,
HIF_PM_HTC_STATS_PUT_HTT_FETCH_PKTS);
}
break; break;
} }
pPacket = htc_packet_dequeue(tx_queue); pPacket = htc_packet_dequeue(tx_queue);
if (!pPacket) { if (!pPacket) {
if (do_pm_get) if (do_pm_get) {
hif_pm_runtime_put(target->hif_dev, rtpm_dbgid); hif_pm_runtime_put(target->hif_dev, rtpm_dbgid);
hif_pm_runtime_update_stats(
target->hif_dev, rtpm_dbgid,
HIF_PM_HTC_STATS_PUT_HTT_FETCH_PKTS);
}
break; break;
} }
@@ -2577,6 +2588,10 @@ void htc_kick_queues(void *context)
if (hif_pm_runtime_get_sync(target->hif_dev, RTPM_ID_HTC)) if (hif_pm_runtime_get_sync(target->hif_dev, RTPM_ID_HTC))
return; return;
hif_pm_runtime_update_stats(
target->hif_dev, RTPM_ID_HTC,
HIF_PM_HTC_STATS_GET_HTC_KICK_QUEUES);
for (i = 0; i < ENDPOINT_MAX; i++) { for (i = 0; i < ENDPOINT_MAX; i++) {
endpoint = &target->endpoint[i]; endpoint = &target->endpoint[i];
@@ -2592,7 +2607,12 @@ void htc_kick_queues(void *context)
hif_fastpath_resume(target->hif_dev); hif_fastpath_resume(target->hif_dev);
hif_pm_runtime_put(target->hif_dev, RTPM_ID_HTC); if (hif_pm_runtime_put(target->hif_dev, RTPM_ID_HTC))
return;
hif_pm_runtime_update_stats(
target->hif_dev, RTPM_ID_HTC,
HIF_PM_HTC_STATS_PUT_HTC_KICK_QUEUES);
} }
#endif #endif