qcacmn: Replace RET_IP with rtpm_dbgid for runtime pm api

Current it use __RET_IP to get caller in rtpm resume
function, if it print info by %ps, it will do a
symbol lookup which takes time.

Change as replacing __RET_IP with rtpm_dbgid, so it is
still able to get caller information and avoid time
cost here.

Change-Id: Ifc70c118d621bb9e6d12de87582de09316ae9cad
CRs-Fixed: 3001690
This commit is contained in:
Jingxiang Ge
2021-07-27 17:27:18 +08:00
committed by Madan Koyyalamudi
parent 9008f98623
commit 0f98450843
4 changed files with 62 additions and 29 deletions

View File

@@ -1053,21 +1053,33 @@ hif_pm_wake_irq_type hif_pm_get_wake_irq_type(struct hif_opaque_softc *hif_ctx);
* @RTPM_ID_DW_TX_HW_ENQUEUE: operation in functin dp_tx_hw_enqueue
* @RTPM_ID_HAL_REO_CMD: HAL_REO_CMD operation
* @RTPM_ID_DP_PRINT_RING_STATS: operation in dp_print_ring_stats
* @RTPM_ID_PM_STOP: operation in hif_pm_runtime_stop
* @RTPM_ID_CONN_DISCONNECT:operation when issue disconnect
* @RTPM_ID_SOC_REMOVE: operation in soc remove
* @RTPM_ID_DRIVER_UNLOAD: operation in driver unload
* @RTPM_ID_CE_INTR_HANDLER: operation from ce interrupt handler
* @RTPM_ID_WAKE_INTR_HANDLER: operation from wake interrupt handler
*/
/* New value added to the enum must also be reflected in function
* rtpm_string_from_dbgid()
*/
typedef enum {
RTPM_ID_RESVERD = 0,
RTPM_ID_WMI = 1,
RTPM_ID_HTC = 2,
RTPM_ID_QOS_NOTIFY = 3,
RTPM_ID_DP_TX_DESC_ALLOC_FREE = 4,
RTPM_ID_CE_SEND_FAST = 5,
RTPM_ID_SUSPEND_RESUME = 6,
RTPM_ID_DW_TX_HW_ENQUEUE = 7,
RTPM_ID_HAL_REO_CMD = 8,
RTPM_ID_DP_PRINT_RING_STATS = 9,
RTPM_ID_WMI,
RTPM_ID_HTC,
RTPM_ID_QOS_NOTIFY,
RTPM_ID_DP_TX_DESC_ALLOC_FREE,
RTPM_ID_CE_SEND_FAST,
RTPM_ID_SUSPEND_RESUME,
RTPM_ID_DW_TX_HW_ENQUEUE,
RTPM_ID_HAL_REO_CMD,
RTPM_ID_DP_PRINT_RING_STATS,
RTPM_ID_PM_STOP,
RTPM_ID_CONN_DISCONNECT,
RTPM_ID_SOC_REMOVE,
RTPM_ID_DRIVER_UNLOAD,
RTPM_ID_CE_INTR_HANDLER,
RTPM_ID_WAKE_INTR_HANDLER,
RTPM_ID_MAX,
} wlan_rtpm_dbgid;
@@ -1092,6 +1104,12 @@ static inline char *rtpm_string_from_dbgid(wlan_rtpm_dbgid id)
"RTPM_ID_DW_TX_HW_ENQUEUE",
"RTPM_ID_HAL_REO_CMD",
"RTPM_ID_DP_PRINT_RING_STATS",
"RTPM_ID_PM_STOP",
"RTPM_ID_CONN_DISCONNECT",
"RTPM_ID_SOC_REMOVE",
"RTPM_ID_DRIVER_UNLOAD",
"RTPM_ID_CE_INTR_HANDLER",
"RTPM_ID_WAKE_INTR_HANDLER",
"RTPM_ID_MAX"};
return (char *)strings[id];
@@ -1171,7 +1189,8 @@ int hif_pm_runtime_get_sync(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid);
int hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid);
int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid);
int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid,
bool is_critical_ctx);
@@ -1199,7 +1218,8 @@ void hif_pm_runtime_check_and_request_resume(struct hif_opaque_softc *hif_ctx);
void hif_pm_runtime_mark_dp_rx_busy(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_is_dp_rx_busy(struct hif_opaque_softc *hif_ctx);
qdf_time_t hif_pm_runtime_get_dp_rx_busy_mark(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid);
void hif_pm_runtime_update_stats(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid,
enum hif_pm_htc_stats stats);
@@ -1233,7 +1253,8 @@ hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid)
{ return 0; }
static inline int
hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx)
hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid)
{ return 0; }
static inline void
hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
@@ -1291,7 +1312,8 @@ hif_pm_runtime_is_dp_rx_busy(struct hif_opaque_softc *hif_ctx)
static inline qdf_time_t
hif_pm_runtime_get_dp_rx_busy_mark(struct hif_opaque_softc *hif_ctx)
{ return 0; }
static inline int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx)
static inline int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid)
{ return 0; }
static inline
void hif_pm_set_link_state(struct hif_opaque_softc *hif_handle, uint8_t val)

View File

@@ -2104,7 +2104,8 @@ irqreturn_t hif_wake_interrupt_handler(int irq, void *context)
if (hif_pm_runtime_get_monitor_wake_intr(hif_ctx)) {
hif_pm_runtime_set_monitor_wake_intr(hif_ctx, 0);
hif_pm_runtime_request_resume(hif_ctx);
hif_pm_runtime_request_resume(hif_ctx,
RTPM_ID_WAKE_INTR_HANDLER);
}
if (scn->initial_wakeup_cb)

View File

@@ -193,8 +193,10 @@ static int hif_pci_pm_runtime_debugfs_show(struct seq_file *s, void *data)
int i;
seq_printf(s, "%30s: %s\n", "Runtime PM state", autopm_state[pm_state]);
seq_printf(s, "%30s: %ps\n", "Last Resume Caller",
rpm_ctx->pm_stats.last_resume_caller);
seq_printf(s, "%30s: %d(%s)\n", "last_resume_rtpm_dbgid",
rpm_ctx->pm_stats.last_resume_rtpm_dbgid,
rtpm_string_from_dbgid(
rpm_ctx->pm_stats.last_resume_rtpm_dbgid));
seq_printf(s, "%30s: %ps\n", "Last Busy Marker",
rpm_ctx->pm_stats.last_busy_marker);
@@ -425,7 +427,7 @@ void hif_pm_runtime_stop(struct hif_softc *scn)
hif_runtime_exit(dev);
hif_pm_runtime_sync_resume(GET_HIF_OPAQUE_HDL(scn));
hif_pm_runtime_sync_resume(GET_HIF_OPAQUE_HDL(scn), RTPM_ID_PM_STOP);
qdf_atomic_set(&rpm_ctx->pm_state, HIF_PM_RUNTIME_STATE_NONE);
@@ -569,12 +571,14 @@ void hif_pm_runtime_close(struct hif_softc *scn)
/**
* hif_pm_runtime_sync_resume() - Invoke synchronous runtime resume.
* @hif_ctx: hif context
* @rtpm_dbgid: dbgid to trace who use it
*
* This function will invoke synchronous runtime resume.
*
* Return: status
*/
int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx)
int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_runtime_pm_ctx *rpm_ctx;
@@ -590,11 +594,12 @@ int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx)
pm_state = qdf_atomic_read(&rpm_ctx->pm_state);
if (pm_state == HIF_PM_RUNTIME_STATE_SUSPENDED ||
pm_state == HIF_PM_RUNTIME_STATE_SUSPENDING)
hif_info("Runtime PM resume is requested by %ps",
(void *)_RET_IP_);
hif_info("request runtime PM resume, rtpm_dbgid(%d,%s)",
rtpm_dbgid,
rtpm_string_from_dbgid(rtpm_dbgid));
rpm_ctx->pm_stats.request_resume++;
rpm_ctx->pm_stats.last_resume_caller = (void *)_RET_IP_;
rpm_ctx->pm_stats.last_resume_rtpm_dbgid = rtpm_dbgid;
return pm_runtime_resume(hif_bus_get_dev(scn));
}
@@ -1091,12 +1096,14 @@ int hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx,
/**
* hif_pm_runtime_request_resume() - Invoke async runtime resume
* @hif_ctx: hif context
* @rtpm_dbgid: dbgid to trace who use it
*
* This function will invoke asynchronous runtime resume.
*
* Return: status
*/
int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx)
int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_runtime_pm_ctx *rpm_ctx;
@@ -1112,10 +1119,12 @@ int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx)
pm_state = qdf_atomic_read(&rpm_ctx->pm_state);
if (pm_state == HIF_PM_RUNTIME_STATE_SUSPENDED ||
pm_state == HIF_PM_RUNTIME_STATE_SUSPENDING)
hif_info("Runtime PM resume is requested by wake_irq");
hif_info("request runtime PM resume, rtpm_dbgid(%d,%s)",
rtpm_dbgid,
rtpm_string_from_dbgid(rtpm_dbgid));
rpm_ctx->pm_stats.request_resume++;
rpm_ctx->pm_stats.last_resume_caller = (void *)_RET_IP_;
rpm_ctx->pm_stats.last_resume_rtpm_dbgid = rtpm_dbgid;
return hif_pm_request_resume(hif_bus_get_dev(scn));
}
@@ -1237,8 +1246,9 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
pm_state == HIF_PM_RUNTIME_STATE_SUSPENDING) {
/* Do not log in performance path */
if (!is_critical_ctx) {
hif_info_high("Runtime PM resume is requested by %ps",
(void *)_RET_IP_);
hif_info_high("request runtime PM resume, rtpm_dbgid(%d-%s)",
rtpm_dbgid,
rtpm_string_from_dbgid(rtpm_dbgid));
}
ret = -EAGAIN;
} else {
@@ -1246,7 +1256,7 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
}
rpm_ctx->pm_stats.request_resume++;
rpm_ctx->pm_stats.last_resume_caller = (void *)_RET_IP_;
rpm_ctx->pm_stats.last_resume_rtpm_dbgid = rtpm_dbgid;
hif_pm_request_resume(dev);
return ret;
@@ -1738,7 +1748,7 @@ void hif_pm_runtime_check_and_request_resume(struct hif_opaque_softc *hif_ctx)
hif_pm_runtime_suspend_lock(hif_ctx);
if (hif_pm_runtime_is_suspended(hif_ctx)) {
hif_pm_runtime_suspend_unlock(hif_ctx);
hif_pm_runtime_request_resume(hif_ctx);
hif_pm_runtime_request_resume(hif_ctx, RTPM_ID_CE_INTR_HANDLER);
} else {
hif_pm_runtime_suspend_unlock(hif_ctx);
}

View File

@@ -79,7 +79,7 @@ struct hif_pci_pm_stats {
u32 prevent_suspend_timeout;
u32 allow_suspend_timeout;
u32 runtime_get_err;
void *last_resume_caller;
wlan_rtpm_dbgid last_resume_rtpm_dbgid;
void *last_busy_marker;
qdf_time_t last_busy_timestamp;
unsigned long suspend_jiffies;