Browse Source

qcacld-3.0: Check for SSR on fw timeouts

During SSR firmware is reloaded and FW responses for previous
vdev sessions are not received. Thus check for SSR before host
crash trigger on FW timeout.

Change-Id: I8be8b7264c133fa115a5b6ac6a3b865f7040e739
CRs-fixed: 2005995
Manikandan Mohan 8 years ago
parent
commit
b089ed654d
1 changed files with 22 additions and 14 deletions
  1. 22 14
      core/wma/src/wma_dev_if.c

+ 22 - 14
core/wma/src/wma_dev_if.c

@@ -2250,6 +2250,14 @@ int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
 	return status;
 }
 
+static inline bool wma_crash_on_fw_timeout(bool crash_enabled)
+{
+	/* Discard FW timeouts and dont crash during SSR */
+	if (cds_is_driver_recovering())
+		return false;
+
+	return crash_enabled;
+}
 
 /**
  * wma_hold_req_timer() - wma hold request timeout function
@@ -2285,8 +2293,8 @@ 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->fw_timeout_crash == true)
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
+			QDF_BUG(0);
 		else
 			wma_send_msg(wma, WMA_ADD_STA_RSP, (void *)params, 0);
 	} else if (tgt_req->msg_type == WMA_ADD_BSS_REQ) {
@@ -2295,8 +2303,8 @@ 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->fw_timeout_crash == true)
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
+			QDF_BUG(0);
 		else
 			wma_send_msg(wma, WMA_ADD_BSS_RSP, (void *)params, 0);
 	} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
@@ -2308,8 +2316,8 @@ void wma_hold_req_timer(void *data)
 		WMA_LOGP(FL("Sending del sta rsp to umac (mac:%pM, status:%d)"),
 			 params->staMac, params->status);
 
-		if (wma->fw_timeout_crash == true) {
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+			QDF_BUG(0);
 		} else {
 			/*
 			 * Assert in development build only.
@@ -2464,8 +2472,8 @@ void wma_vdev_resp_timer(void *data)
 		WMA_LOGA("%s: WMA_SWITCH_CHANNEL_REQ timedout", __func__);
 
 		/* Trigger host crash if the flag is set */
-		if (wma->fw_timeout_crash == true)
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
+			QDF_BUG(0);
 		else
 			wma_send_msg(wma, WMA_SWITCH_CHANNEL_RSP,
 				    (void *)params, 0);
@@ -2496,8 +2504,8 @@ void wma_vdev_resp_timer(void *data)
 			goto free_tgt_req;
 		}
 		/* Trigger host crash when vdev response timesout */
-		if (wma->fw_timeout_crash == true) {
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+			QDF_BUG(0);
 			return;
 		}
 
@@ -2564,8 +2572,8 @@ void wma_vdev_resp_timer(void *data)
 		params->status = QDF_STATUS_E_TIMEOUT;
 
 		WMA_LOGA("%s: WMA_DEL_STA_SELF_REQ timedout", __func__);
-		if (wma->fw_timeout_crash == true) {
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+			QDF_BUG(0);
 		} else {
 			sme_msg.type = eWNI_SME_DEL_STA_SELF_RSP;
 			sme_msg.bodyptr = iface->del_staself_req;
@@ -2590,8 +2598,8 @@ void wma_vdev_resp_timer(void *data)
 		WMA_LOGA("%s: WMA_ADD_BSS_REQ timedout", __func__);
 		WMA_LOGI("%s: bssid %pM vdev_id %d", __func__, params->bssId,
 			 tgt_req->vdev_id);
-		if (wma->fw_timeout_crash == true) {
-			BUG_ON(1);
+		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+			QDF_BUG(0);
 		} else {
 			wma_send_msg(wma, WMA_ADD_BSS_RSP, (void *)params, 0);
 			QDF_ASSERT(0);