qcacld-3.0: Remove IPA uC stat log when IPA pipe is suspended

There's an excessive log for IPA uC stat request reason even when
WDI pipe is suspended.
Enable IPA uC stat request reason log only when IPA pipe is resumed.

Change-Id: I35d98e02a9180738bc9cdb25f59e31d572df9e0e
CRs-Fixed: 2181952
This commit is contained in:
Yun Park
2018-04-09 12:05:49 -07:00
committed by nshrivas
parent 4b42917ba0
commit a29974a3ae
7 changed files with 89 additions and 20 deletions

View File

@@ -587,5 +587,12 @@ QDF_STATUS wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
*/ */
int wlan_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr); int wlan_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
/**
* wlan_ipa_is_fw_wdi_activated() - Is FW WDI actived?
* @ipa_ctx: IPA contex
*
* Return: true if FW WDI actived, false otherwise
*/
bool wlan_ipa_is_fw_wdi_activated(struct wlan_ipa_priv *ipa_ctx);
#endif /* IPA_OFFLOAD */ #endif /* IPA_OFFLOAD */
#endif /* _WLAN_IPA_CORE_H_ */ #endif /* _WLAN_IPA_CORE_H_ */

View File

@@ -360,5 +360,12 @@ QDF_STATUS ipa_wlan_evt(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev,
*/ */
int ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr); int ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
/**
* ipa_is_fw_wdi_activated - Is FW WDI activated?
* @pdev: pdev obj
*
* Return: true if FW WDI activated, false otherwise
*/
bool ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev);
#endif /* IPA_OFFLOAD */ #endif /* IPA_OFFLOAD */
#endif /* end of _WLAN_IPA_MAIN_H_ */ #endif /* end of _WLAN_IPA_MAIN_H_ */

View File

@@ -1462,8 +1462,7 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
} else { } else {
/* Disable IPA UC TX PIPE when STA disconnected */ /* Disable IPA UC TX PIPE when STA disconnected */
if ((ipa_ctx->num_iface == 1) && if ((ipa_ctx->num_iface == 1) &&
(ipa_ctx->activated_fw_pipe == wlan_ipa_is_fw_wdi_activated(ipa_ctx) &&
WLAN_IPA_UC_NUM_WDI_PIPE) &&
!ipa_ctx->ipa_pipes_down) !ipa_ctx->ipa_pipes_down)
wlan_ipa_uc_handle_last_discon(ipa_ctx); wlan_ipa_uc_handle_last_discon(ipa_ctx);
} }
@@ -1496,7 +1495,7 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
qdf_mutex_acquire(&ipa_ctx->event_lock); qdf_mutex_acquire(&ipa_ctx->event_lock);
if ((ipa_ctx->num_iface == 1) && if ((ipa_ctx->num_iface == 1) &&
(ipa_ctx->activated_fw_pipe == WLAN_IPA_UC_NUM_WDI_PIPE) && wlan_ipa_is_fw_wdi_activated(ipa_ctx) &&
!ipa_ctx->ipa_pipes_down) { !ipa_ctx->ipa_pipes_down) {
if (cds_is_driver_unloading()) { if (cds_is_driver_unloading()) {
/* /*
@@ -1664,10 +1663,9 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
/* Disable IPA UC TX PIPE when last STA disconnected */ /* Disable IPA UC TX PIPE when last STA disconnected */
if (!ipa_ctx->sap_num_connected_sta && if (!ipa_ctx->sap_num_connected_sta &&
ipa_ctx->uc_loaded == true) { ipa_ctx->uc_loaded == true) {
if ((false == ipa_ctx->resource_unloading) if ((false == ipa_ctx->resource_unloading) &&
&& (WLAN_IPA_UC_NUM_WDI_PIPE == wlan_ipa_is_fw_wdi_activated(ipa_ctx) &&
ipa_ctx->activated_fw_pipe) && !ipa_ctx->ipa_pipes_down) {
!ipa_ctx->ipa_pipes_down) {
wlan_ipa_uc_handle_last_discon(ipa_ctx); wlan_ipa_uc_handle_last_discon(ipa_ctx);
} }
@@ -2401,7 +2399,7 @@ static void wlan_ipa_uc_op_cb(struct op_msg_type *op_msg,
(msg->op_code == WLAN_IPA_UC_OPCODE_RX_RESUME)) { (msg->op_code == WLAN_IPA_UC_OPCODE_RX_RESUME)) {
qdf_mutex_acquire(&ipa_ctx->ipa_lock); qdf_mutex_acquire(&ipa_ctx->ipa_lock);
ipa_ctx->activated_fw_pipe++; ipa_ctx->activated_fw_pipe++;
if (ipa_ctx->activated_fw_pipe == WLAN_IPA_UC_NUM_WDI_PIPE) { if (wlan_ipa_is_fw_wdi_activated(ipa_ctx)) {
ipa_ctx->resource_loading = false; ipa_ctx->resource_loading = false;
qdf_event_set(&ipa_ctx->ipa_resource_comp); qdf_event_set(&ipa_ctx->ipa_resource_comp);
if (ipa_ctx->wdi_enabled == false) { if (ipa_ctx->wdi_enabled == false) {
@@ -2658,3 +2656,15 @@ int wlan_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
else else
return qdf_ipa_release_wdi_mapping(num_buf, buf_arr); return qdf_ipa_release_wdi_mapping(num_buf, buf_arr);
} }
/**
* wlan_ipa_is_fw_wdi_activated() - Is FW WDI actived?
* @ipa_ctx: IPA contex
*
* Return: true if FW WDI actived, false otherwise
*/
bool wlan_ipa_is_fw_wdi_activated(struct wlan_ipa_priv *ipa_ctx)
{
return (WLAN_IPA_UC_NUM_WDI_PIPE == ipa_ctx->activated_fw_pipe);
}

View File

@@ -530,3 +530,27 @@ int ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
{ {
return wlan_ipa_uc_smmu_map(map, num_buf, buf_arr); return wlan_ipa_uc_smmu_map(map, num_buf, buf_arr);
} }
/**
* ipa_is_fw_wdi_activated - Is FW WDI activated?
* @pdev: pdev obj
*
* Return: true if FW WDI activated, false otherwise
*/
bool ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
{
struct wlan_ipa_priv *ipa_obj;
if (!ipa_config_is_enabled()) {
ipa_info("ipa is disabled");
return false;
}
ipa_obj = ipa_pdev_get_priv_obj(pdev);
if (!ipa_obj) {
ipa_err("IPA object is NULL");
return false;
}
return wlan_ipa_is_fw_wdi_activated(ipa_obj);
}

View File

@@ -282,6 +282,14 @@ QDF_STATUS ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev *pdev,
*/ */
int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr); int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
/**
* ucfg_ipa_is_fw_wdi_activated - Is FW WDI activated?
* @pdev: pdev obj
*
* Return: true if FW WDI activated, false otherwise
*/
bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev);
#else #else
static inline bool ucfg_ipa_is_present(void) static inline bool ucfg_ipa_is_present(void)
@@ -438,5 +446,11 @@ int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
{ {
return 0; return 0;
} }
static inline
bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
{
return false;
}
#endif /* IPA_OFFLOAD */ #endif /* IPA_OFFLOAD */
#endif /* _WLAN_IPA_UCFG_API_H_ */ #endif /* _WLAN_IPA_UCFG_API_H_ */

View File

@@ -169,3 +169,8 @@ int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
{ {
return ipa_uc_smmu_map(map, num_buf, buf_arr); return ipa_uc_smmu_map(map, num_buf, buf_arr);
} }
bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
{
return ipa_is_fw_wdi_activated(pdev);
}

View File

@@ -7251,24 +7251,26 @@ static void hdd_bus_bw_work_handler(struct work_struct *work)
connected = true; connected = true;
} }
/* add intra bss forwarded tx and rx packets */
tx_packets += fwd_tx_packets_diff;
rx_packets += fwd_rx_packets_diff;
ucfg_ipa_uc_stat_query(hdd_ctx->hdd_pdev, &ipa_tx_packets,
&ipa_rx_packets);
tx_packets += (uint64_t)ipa_tx_packets;
rx_packets += (uint64_t)ipa_rx_packets;
if (!connected) { if (!connected) {
hdd_err("bus bandwidth timer running in disconnected state"); hdd_err("bus bandwidth timer running in disconnected state");
return; return;
} }
hdd_pld_request_bus_bandwidth(hdd_ctx, tx_packets, rx_packets); /* add intra bss forwarded tx and rx packets */
tx_packets += fwd_tx_packets_diff;
rx_packets += fwd_rx_packets_diff;
ucfg_ipa_set_perf_level(hdd_ctx->hdd_pdev, tx_packets, rx_packets); if (ucfg_ipa_is_fw_wdi_activated(hdd_ctx->hdd_pdev)) {
ucfg_ipa_uc_stat_request(hdd_ctx->hdd_pdev, 2); ucfg_ipa_uc_stat_query(hdd_ctx->hdd_pdev, &ipa_tx_packets,
&ipa_rx_packets);
tx_packets += (uint64_t)ipa_tx_packets;
rx_packets += (uint64_t)ipa_rx_packets;
ucfg_ipa_set_perf_level(hdd_ctx->hdd_pdev, tx_packets, rx_packets);
ucfg_ipa_uc_stat_request(hdd_ctx->hdd_pdev, 2);
}
hdd_pld_request_bus_bandwidth(hdd_ctx, tx_packets, rx_packets);
restart_timer: restart_timer:
/* ensure periodic timer should still be running before restarting it */ /* ensure periodic timer should still be running before restarting it */