qcacmn: Avoid logging in packet transmission path

Currently if the driver is in runtime suspend/suspending
state, any packet transmission will request for resume
via hif_pm_runtime_get.

Unfortunately there is a logging in the above API which
will lead to more time consumption in the NET_TX softirq
context. This can lead to other delay in processing other
softirqs in the system.

Fix this by skipping the logging in the packet transmission
path.

Change-Id: Icc9f5b67794f7666243eb059f2e07a06a987002e
CRs-Fixed: 2844126
This commit is contained in:
Rakesh Pillai
2021-01-07 14:39:50 +05:30
committed by snandini
parent 0e5b3623ef
commit 6ee7aeb0bd
8 changed files with 28 additions and 20 deletions

View File

@@ -1433,7 +1433,7 @@ dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev,
ring_access_fail: ring_access_fail:
if (hif_pm_runtime_get(soc->hif_handle, if (hif_pm_runtime_get(soc->hif_handle,
RTPM_ID_DW_TX_HW_ENQUEUE) == 0) { RTPM_ID_DW_TX_HW_ENQUEUE, true) == 0) {
dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce); dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
hif_pm_runtime_put(soc->hif_handle, hif_pm_runtime_put(soc->hif_handle,
RTPM_ID_DW_TX_HW_ENQUEUE); RTPM_ID_DW_TX_HW_ENQUEUE);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -455,7 +455,7 @@ inline int hal_reo_cmd_queue_stats(hal_ring_handle_t hal_ring_hdl,
cmd->u.stats_params.clear); cmd->u.stats_params.clear);
if (hif_pm_runtime_get(hal_soc->hif_handle, if (hif_pm_runtime_get(hal_soc->hif_handle,
RTPM_ID_HAL_REO_CMD) == 0) { RTPM_ID_HAL_REO_CMD, false) == 0) {
hal_srng_access_end(hal_soc_hdl, hal_ring_hdl); hal_srng_access_end(hal_soc_hdl, hal_ring_hdl);
hif_pm_runtime_put(hal_soc->hif_handle, hif_pm_runtime_put(hal_soc->hif_handle,
RTPM_ID_HAL_REO_CMD); RTPM_ID_HAL_REO_CMD);
@@ -592,7 +592,7 @@ inline int hal_reo_cmd_flush_cache(hal_ring_handle_t hal_ring_hdl,
cp->flush_all); cp->flush_all);
if (hif_pm_runtime_get(hal_soc->hif_handle, if (hif_pm_runtime_get(hal_soc->hif_handle,
RTPM_ID_HAL_REO_CMD) == 0) { RTPM_ID_HAL_REO_CMD, false) == 0) {
hal_srng_access_end(hal_soc_hdl, hal_ring_hdl); hal_srng_access_end(hal_soc_hdl, hal_ring_hdl);
hif_pm_runtime_put(hal_soc->hif_handle, hif_pm_runtime_put(hal_soc->hif_handle,
RTPM_ID_HAL_REO_CMD); RTPM_ID_HAL_REO_CMD);
@@ -916,7 +916,7 @@ inline int hal_reo_cmd_update_rx_queue(hal_ring_handle_t hal_ring_hdl,
PN_127_96, p->pn_127_96); PN_127_96, p->pn_127_96);
if (hif_pm_runtime_get(hal_soc->hif_handle, if (hif_pm_runtime_get(hal_soc->hif_handle,
RTPM_ID_HAL_REO_CMD) == 0) { RTPM_ID_HAL_REO_CMD, false) == 0) {
hal_srng_access_end(hal_soc_hdl, hal_ring_hdl); hal_srng_access_end(hal_soc_hdl, hal_ring_hdl);
hif_pm_runtime_put(hal_soc->hif_handle, hif_pm_runtime_put(hal_soc->hif_handle,
RTPM_ID_HAL_REO_CMD); RTPM_ID_HAL_REO_CMD);

View File

@@ -1031,7 +1031,8 @@ int hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid); 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);
int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx, int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid); wlan_rtpm_dbgid rtpm_dbgid,
bool is_critical_ctx);
void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx, void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid); wlan_rtpm_dbgid rtpm_dbgid);
int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx, int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx,
@@ -1079,7 +1080,8 @@ hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
{} {}
static inline int static inline int
hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx, wlan_rtpm_dbgid rtpm_dbgid) hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx, wlan_rtpm_dbgid rtpm_dbgid,
bool is_critical_ctx)
{ return 0; } { return 0; }
static inline int static inline int
hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx, wlan_rtpm_dbgid rtpm_dbgid) hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx, wlan_rtpm_dbgid rtpm_dbgid)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -148,7 +148,7 @@ int ce_send_fast(struct CE_handle *copyeng, qdf_nbuf_t msdu,
* sure there is no PCIe link access. * sure there is no PCIe link access.
*/ */
if (hif_pm_runtime_get(hif_hdl, if (hif_pm_runtime_get(hif_hdl,
RTPM_ID_CE_SEND_FAST) != 0) RTPM_ID_CE_SEND_FAST, false) != 0)
ok_to_send = false; ok_to_send = false;
if (ok_to_send) { if (ok_to_send) {

View File

@@ -1150,6 +1150,8 @@ void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
* hif_pm_runtime_get() - do a get opperation on the device * hif_pm_runtime_get() - do a get opperation on the device
* @hif_ctx: pointer of HIF context * @hif_ctx: pointer of HIF context
* @rtpm_dbgid: dbgid to trace who use it * @rtpm_dbgid: dbgid to trace who use it
* @is_critical_ctx: Indication if this function called via a
* critical context
* *
* A get opperation will prevent a runtime suspend until a * A get opperation will prevent a runtime suspend until a
* corresponding put is done. This api should be used when sending * corresponding put is done. This api should be used when sending
@@ -1162,7 +1164,8 @@ void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
* otherwise an error code. * otherwise an error code.
*/ */
int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx, int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
wlan_rtpm_dbgid rtpm_dbgid) wlan_rtpm_dbgid rtpm_dbgid,
bool is_critical_ctx)
{ {
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_runtime_pm_ctx *rpm_ctx; struct hif_runtime_pm_ctx *rpm_ctx;
@@ -1207,8 +1210,11 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
if (pm_state == HIF_PM_RUNTIME_STATE_SUSPENDED || if (pm_state == HIF_PM_RUNTIME_STATE_SUSPENDED ||
pm_state == HIF_PM_RUNTIME_STATE_SUSPENDING) { 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", hif_info_high("Runtime PM resume is requested by %ps",
(void *)_RET_IP_); (void *)_RET_IP_);
}
ret = -EAGAIN; ret = -EAGAIN;
} else { } else {
ret = -EBUSY; ret = -EBUSY;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -1174,7 +1174,7 @@ int htc_pm_runtime_get(HTC_HANDLE htc_handle)
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
return hif_pm_runtime_get(target->hif_dev, return hif_pm_runtime_get(target->hif_dev,
RTPM_ID_HTC); RTPM_ID_HTC, false);
} }
int htc_pm_runtime_put(HTC_HANDLE htc_handle) int htc_pm_runtime_put(HTC_HANDLE htc_handle)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -1103,7 +1103,7 @@ static void get_htc_send_packets_credit_based(HTC_TARGET *target,
htc_send_pkts_rtpm_dbgid_get( htc_send_pkts_rtpm_dbgid_get(
pEndpoint->service_id); pEndpoint->service_id);
ret = hif_pm_runtime_get(target->hif_dev, ret = hif_pm_runtime_get(target->hif_dev,
rtpm_dbgid); rtpm_dbgid, false);
if (ret) { if (ret) {
/* bus suspended, runtime resume issued */ /* bus suspended, runtime resume issued */
QDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0); QDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0);
@@ -1252,7 +1252,7 @@ static void get_htc_send_packets(HTC_TARGET *target,
htc_send_pkts_rtpm_dbgid_get( htc_send_pkts_rtpm_dbgid_get(
pEndpoint->service_id); pEndpoint->service_id);
ret = hif_pm_runtime_get(target->hif_dev, ret = hif_pm_runtime_get(target->hif_dev,
rtpm_dbgid); rtpm_dbgid, false);
if (ret) { if (ret) {
/* bus suspended, runtime resume issued */ /* bus suspended, runtime resume issued */
QDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0); QDF_ASSERT(HTC_PACKET_QUEUE_DEPTH(pQueue) == 0);
@@ -1932,7 +1932,7 @@ QDF_STATUS htc_send_data_pkt(HTC_HANDLE htc_hdl, qdf_nbuf_t netbuf, int ep_id,
rtpm_dbgid = rtpm_dbgid =
htc_send_pkts_rtpm_dbgid_get(pEndpoint->service_id); htc_send_pkts_rtpm_dbgid_get(pEndpoint->service_id);
if (hif_pm_runtime_get(target->hif_dev, rtpm_dbgid)) if (hif_pm_runtime_get(target->hif_dev, rtpm_dbgid, false))
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
p_htc_hdr = (HTC_FRAME_HDR *)qdf_nbuf_get_frag_vaddr(netbuf, 0); p_htc_hdr = (HTC_FRAME_HDR *)qdf_nbuf_get_frag_vaddr(netbuf, 0);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -499,7 +499,7 @@ QDF_STATUS qdf_runtime_pm_get(void)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
ret = hif_pm_runtime_get(ol_sc, RTPM_ID_RESVERD); ret = hif_pm_runtime_get(ol_sc, RTPM_ID_RESVERD, false);
if (ret) if (ret)
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;