qcacmn: Add throughput based RTPM API support

Add support to invoke HIF runtime PM APIs in TX packet path based on
throughput level. Essentially at high throughputs, where runtime PM is
not expected to provide power gains, invoking the APIs is deterimental to
performance.
Hence invoke runtime_pm APIs based on throughput level.

CRs-Fixed: 3059712
Change-Id: I49d111bffa8a37c68abbdd54911f9ecc22430562
此提交包含在:
Mohit Khanna
2021-10-14 06:53:35 -07:00
提交者 Madan Koyyalamudi
父節點 25652ed9d8
當前提交 81e29163db
共有 7 個檔案被更改,包括 91 行新增0 行删除

查看文件

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1418,6 +1419,10 @@ dp_tx_ring_access_end(struct dp_soc *soc, hal_ring_handle_t hal_ring_hdl,
#endif
#ifdef FEATURE_RUNTIME_PM
static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
{
return qdf_atomic_read(&soc->rtpm_high_tput_flag);
}
/**
* dp_tx_ring_access_end_wrapper() - Wrapper for ring access end
* @soc: Datapath soc handle
@@ -1436,6 +1441,14 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
{
int ret;
/*
* Avoid runtime get and put APIs under high throughput scenarios.
*/
if (dp_get_rtpm_tput_policy_requirement(soc)) {
dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
return;
}
ret = hif_pm_runtime_get(soc->hif_handle,
RTPM_ID_DW_TX_HW_ENQUEUE, true);
switch (ret) {
@@ -1474,6 +1487,11 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
dp_runtime_put(soc);
}
}
#else
static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
{
return 0;
}
#endif
/**