From 612e39686b3827e647a3cc57cf40220f9eabfd1f Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 11 Jul 2018 16:29:21 +0530 Subject: qcacmn: Check for target ready before sending wmi command SAP stop is in progress when FW down event is received from platform driver. Vdev_stop command is not sent to firmware due to target ready check but same check is not present for self peer_delete command. This results in assert in firmware since vdev_stop command is not received before self peer_delete command. Fix is to check if target is ready before sending wmi command. Change-Id: I91fa6aaffe4f35b446a3c8748f168e83620bf4b0 CRs-Fixed: 2277544 --- wmi/inc/wmi_unified_api.h | 9 +++++++++ wmi/inc/wmi_unified_priv.h | 1 + wmi/src/wmi_unified.c | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 8c98fe836152..1592ce5876d6 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1613,4 +1613,13 @@ QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl, */ QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl, struct wmi_invoke_neighbor_report_params *params); +/** + * wmi_register_tgt_ready_cb() - Register target ready check callback + * with wmi_handle + * @wmi_handle: wmi handle + * @cb: Callback to check target ready + * + * Return: None + */ +void wmi_register_tgt_ready_cb(wmi_unified_t wmi_handle, bool (*cb)(void)); #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 5394bbdfb8ba..8ecd32c83a96 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1323,6 +1323,7 @@ struct wmi_unified { uint32_t vdev_param[wmi_vdev_param_max]; uint32_t services[wmi_services_max]; #endif + bool (*is_target_ready)(void); }; #ifdef WMI_NON_TLV_SUPPORT /* ONLY_NON_TLV_TARGET:TLV attach dummy function defintion for case when diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index d9f128dbba10..4ee9d67da8e5 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1283,6 +1283,9 @@ QDF_STATUS wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, QDF_STATUS status; uint16_t htc_tag = 0; + if (wmi_handle->is_target_ready && !wmi_handle->is_target_ready()) + return QDF_STATUS_E_FAILURE; + if (wmi_get_runtime_pm_inprogress(wmi_handle)) { htc_tag = (A_UINT16)wmi_handle->ops->wmi_set_htc_tx_tag( @@ -2129,6 +2132,11 @@ wmi_stop(wmi_unified_t wmi_handle) return 0; } +void wmi_register_tgt_ready_cb(wmi_unified_t wmi_handle, bool (*cb)(void)) +{ + wmi_handle->is_target_ready = cb; +} + #ifdef WMI_NON_TLV_SUPPORT /** * API to flush all the previous packets associated with the wmi endpoint -- cgit v1.2.3 From b5dcb5a4aec1cc0437157ffe9f4c6974b378a6d4 Mon Sep 17 00:00:00 2001 From: Rakshith Suresh Patkar Date: Thu, 2 Aug 2018 15:31:43 +0530 Subject: qcacmn: Increase max history to record per copy engine The max history for each copy engine given by HIF_CE_HISTORY_MAX is currently set to 512. This history is not enough to debug the rootcause of the issue in case of failure to reap from CE. Increase the value to 2048 to accomodate sufficient history per CE for debugging purposes. Change-Id: I79c49e8071e2772eff83b94304914b7babfaecf3 CRs-Fixed: 2283866 --- hif/src/ce/ce_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 2500829a4a26..79d71ba1bb1d 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -99,7 +99,7 @@ struct hif_ce_desc_event { }; /* max history to record per copy engine */ -#define HIF_CE_HISTORY_MAX 512 +#define HIF_CE_HISTORY_MAX 2048 qdf_atomic_t hif_ce_desc_history_index[CE_COUNT_MAX]; struct hif_ce_desc_event hif_ce_desc_history[CE_COUNT_MAX][HIF_CE_HISTORY_MAX]; -- cgit v1.2.3 From ae56618cef3208f07d401c7dcc0c8179a1d6b215 Mon Sep 17 00:00:00 2001 From: jitiphil Date: Mon, 30 Jul 2018 14:13:11 +0530 Subject: qcacmn: Deinit CE tasklet work before CE Cleanup During freeing up of hif_config_de resources, the ce tasklet workers are deinitialized after the ce cleanup is done. This causes a race condition between shutdown and ce tasklet in case rescheduling of ce taslket is done. Deinitialize the taslket workers before ce structures are dismantled. Change-Id: I708711174cf818c0d15ef92c881c8d8aee49e9f1 CRs-Fixed: 2283272 --- hif/src/ce/ce_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 458fff0afb8b..c6816b2a8bea 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -2313,13 +2313,18 @@ void hif_unconfig_ce(struct hif_softc *hif_sc) if (pipe_info->ce_hdl) { ce_unregister_irq(hif_state, (1 << pipe_num)); hif_sc->request_irq_done = false; + } + } + deinit_tasklet_workers(hif_hdl); + for (pipe_num = 0; pipe_num < hif_sc->ce_count; pipe_num++) { + pipe_info = &hif_state->pipe_info[pipe_num]; + if (pipe_info->ce_hdl) { ce_fini(pipe_info->ce_hdl); pipe_info->ce_hdl = NULL; pipe_info->buf_sz = 0; qdf_spinlock_destroy(&pipe_info->recv_bufs_needed_lock); } } - deinit_tasklet_workers(hif_hdl); if (hif_sc->athdiag_procfs_inited) { athdiag_procfs_remove(); hif_sc->athdiag_procfs_inited = false; -- cgit v1.2.3 From 6a3c5f766a6050ef916e5703e25bff25b4610d21 Mon Sep 17 00:00:00 2001 From: Manikandan Mohan Date: Mon, 5 Mar 2018 16:23:21 -0800 Subject: qcacmn: Add WLAN Module name as log prefix Add WLAN module name as logging prefix in multiple wlan driver compilation environment for differentiating the logs pertaining to each driver module. Change-Id: Ib3aeaa280e3beb0de8ceb105e0989cb6004964d6 CRs-fixed: 2197751 --- qdf/linux/src/qdf_trace.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qdf/linux/src/qdf_trace.c b/qdf/linux/src/qdf_trace.c index 397fc6a53259..df38647d55fb 100644 --- a/qdf/linux/src/qdf_trace.c +++ b/qdf/linux/src/qdf_trace.c @@ -281,6 +281,18 @@ void qdf_snprintf(char *str_buffer, unsigned int size, char *str_format, ...) } qdf_export_symbol(qdf_snprintf); +#ifdef MULTI_IF_NAME +static const char *qdf_trace_wlan_modname(void) +{ + return MULTI_IF_NAME; +} +#else +static const char *qdf_trace_wlan_modname(void) +{ + return "wlan"; +} +#endif + #ifdef QDF_ENABLE_TRACING void qdf_vtrace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level, char *str_format, va_list val) @@ -305,7 +317,7 @@ void qdf_vtrace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level, /* print the prefix string into the string buffer... */ n = snprintf(str_buffer, QDF_TRACE_BUFFER_SIZE, - "wlan: [%d:%2s:%3s] ", + "%s: [%d:%2s:%3s] ", qdf_trace_wlan_modname(), in_interrupt() ? 0 : current->pid, (char *)TRACE_LEVEL_STR[level], (char *)g_qdf_trace_info[module].module_name_str); -- cgit v1.2.3