summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@codeaurora.org>2018-05-04 00:31:12 +0530
committernshrivas <nshrivas@codeaurora.org>2018-05-08 03:56:38 -0700
commit9799bf54ca31997cb93f455c7566b4ec2ee7a244 (patch)
tree849daa4f34aab64c1368a7093e8966dae525ebc0
parent43fb96b08fcd9135bda57d7c380de43e2008d536 (diff)
qcacld-3.0: Enable fw_crash_timeout
Presently, fw_crash_timeout is disabled as a result of which if timeout happens for any VDEV related WMI command and device goes in bad state, no assert or recovery is getting triggered. Due to this, device crashes at some later point of time at some random location making debugging difficult. Enable fw_crash_timeout and trigger recovery if recovery is enabled otherwise assert. Change-Id: I9e9e51cba8086bd181be28884c490f0bd77663a8 CRs-Fixed: 2229101
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h4
-rw-r--r--core/wma/src/wma_dev_if.c69
2 files changed, 51 insertions, 22 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 865528047a0e..db46ab7e1f2f 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -10714,7 +10714,7 @@ enum restart_beaconing_on_ch_avoid_rule {
* fw_timeout_crash - Enable/Disable BUG ON
* @Min: 0
* @Max: 1
- * @Default: 0
+ * @Default: 1
*
* This ini is used to Trigger host crash when firmware fails to send the
* response to host
@@ -10732,7 +10732,7 @@ enum restart_beaconing_on_ch_avoid_rule {
#define CFG_CRASH_FW_TIMEOUT_NAME "fw_timeout_crash"
#define CFG_CRASH_FW_TIMEOUT_DISABLE (0)
#define CFG_CRASH_FW_TIMEOUT_ENABLE (1)
-#define CFG_CRASH_FW_TIMEOUT_DEFAULT (0)
+#define CFG_CRASH_FW_TIMEOUT_DEFAULT (1)
/* Hold wakelock for unicast RX packets for the specified duration */
#define CFG_RX_WAKELOCK_TIMEOUT_NAME "rx_wakelock_timeout"
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 000c0e9b19f6..8af9c5bf7f61 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -3011,6 +3011,20 @@ int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
return status;
}
+static void wma_trigger_recovery_assert_on_fw_timeout(
+ uint16_t wma_msg)
+{
+ if (cds_is_self_recovery_enabled()) {
+ WMA_LOGE("%s timed out, triggering recovery",
+ mac_trace_get_wma_msg_string(wma_msg));
+ cds_trigger_recovery(CDS_REASON_UNSPECIFIED);
+ } else {
+ WMA_LOGE("%s timed out, BUG_ON()",
+ mac_trace_get_wma_msg_string(wma_msg));
+ QDF_BUG(0);
+ }
+}
+
static inline bool wma_crash_on_fw_timeout(bool crash_enabled)
{
/* Discard FW timeouts and dont crash during SSR */
@@ -3066,11 +3080,13 @@ void wma_hold_req_timer(void *data)
WMA_LOGA(FL("WMA_ADD_STA_REQ timed out"));
WMA_LOGD(FL("Sending add sta rsp to umac (mac:%pM, status:%d)"),
params->staMac, params->status);
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
- QDF_BUG(0);
- else
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_ADD_STA_REQ);
+ } else {
wma_send_msg_high_priority(wma,
WMA_ADD_STA_RSP, (void *)params, 0);
+ }
} else if (tgt_req->msg_type == WMA_ADD_BSS_REQ) {
tpAddBssParams params = (tpAddBssParams) tgt_req->user_data;
@@ -3078,11 +3094,13 @@ void wma_hold_req_timer(void *data)
WMA_LOGA(FL("WMA_ADD_BSS_REQ timed out"));
WMA_LOGD(FL("Sending add bss rsp to umac (mac:%pM, status:%d)"),
params->selfMacAddr, params->status);
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
- QDF_BUG(0);
- else
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_ADD_BSS_REQ);
+ } else {
wma_send_msg_high_priority(wma,
WMA_ADD_BSS_RSP, (void *)params, 0);
+ }
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_DELETE_STA_RSP_START)) {
tpDeleteStaParams params =
@@ -3093,7 +3111,8 @@ void wma_hold_req_timer(void *data)
params->staMac, params->status);
if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
- QDF_BUG(0);
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_DELETE_STA_REQ);
} else {
/*
* Assert in development build only.
@@ -3112,7 +3131,8 @@ void wma_hold_req_timer(void *data)
WMA_LOGA(FL("wma delete sta p2p request timed out"));
if (wma_crash_on_fw_timeout(wma->fw_timeout_crash)) {
- QDF_BUG(0);
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_DELETE_STA_REQ);
} else {
if (del_sta->generate_rsp)
wma_send_del_sta_self_resp(
@@ -3126,11 +3146,13 @@ void wma_hold_req_timer(void *data)
params->status = false;
WMA_LOGA(FL("wma delete peer for set link timed out"));
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
- QDF_BUG(0);
- else
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_DELETE_STA_REQ);
+ } else {
wma_send_msg(wma, WMA_SET_LINK_STATE_RSP,
params, 0);
+ }
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_DELETE_PEER_RSP)) {
tpDeleteBssParams params =
@@ -3138,11 +3160,13 @@ void wma_hold_req_timer(void *data)
params->status = QDF_STATUS_E_TIMEOUT;
WMA_LOGE(FL("wma delete peer for del bss req timed out"));
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
- QDF_BUG(0);
- else
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_DELETE_STA_REQ);
+ } else {
wma_send_msg_high_priority(wma,
WMA_DELETE_BSS_RSP, params, 0);
+ }
} else {
WMA_LOGE(FL("Unhandled timeout for msg_type:%d and type:%d"),
tgt_req->msg_type, tgt_req->type);
@@ -3300,11 +3324,13 @@ void wma_vdev_resp_timer(void *data)
* Trigger host crash if the flag is set or if the timeout
* is not due to fw down
*/
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
- QDF_BUG(0);
- else
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_CHNL_SWITCH_REQ);
+ } else {
wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
(void *)params, 0);
+ }
if (wma->interfaces[tgt_req->vdev_id].is_channel_switch) {
wma->interfaces[tgt_req->vdev_id].is_channel_switch =
false;
@@ -3336,7 +3362,8 @@ void wma_vdev_resp_timer(void *data)
* is not due to fw down
*/
if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
- QDF_BUG(0);
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_DELETE_BSS_REQ);
return;
}
@@ -3412,7 +3439,8 @@ void wma_vdev_resp_timer(void *data)
WMA_LOGA("%s: WMA_DEL_STA_SELF_REQ timedout", __func__);
if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
- QDF_BUG(0);
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_DEL_STA_SELF_REQ);
} else if (!cds_is_driver_unloading() &&
(cds_is_fw_down() || cds_is_driver_recovering())) {
qdf_mem_free(iface->del_staself_req);
@@ -3442,7 +3470,8 @@ void wma_vdev_resp_timer(void *data)
WMA_LOGD("%s: bssid %pM vdev_id %d", __func__, params->bssId,
tgt_req->vdev_id);
if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
- QDF_BUG(0);
+ wma_trigger_recovery_assert_on_fw_timeout(
+ WMA_ADD_BSS_REQ);
} else {
wma_send_msg_high_priority(wma,
WMA_ADD_BSS_RSP, (void *)params, 0);