瀏覽代碼

qcacmn: Pass hang reason to qdf_trigger_self_recovery

To identify the reason for recovery, add parameter
"reason" for qdf_trigger_self_recovery.

And revise comment for qdf_hang_reason, replace "CDS"
with "QDF".

Change-Id: I8b388b5e83dbbdf29246c264ada56290f0dd3bfc
CRs-Fixed: 2431282
Jingxiang Ge 6 年之前
父節點
當前提交
4218f02cef
共有 4 個文件被更改,包括 21 次插入16 次删除
  1. 5 3
      qdf/inc/qdf_platform.h
  2. 12 10
      qdf/inc/qdf_types.h
  3. 3 2
      qdf/src/qdf_platform.c
  4. 1 1
      wmi/src/wmi_unified.c

+ 5 - 3
qdf/inc/qdf_platform.h

@@ -69,6 +69,7 @@ void qdf_register_self_recovery_callback(qdf_self_recovery_callback callback);
 
 /**
  * qdf_trigger_self_recovery () - trigger self recovery
+ * @reason: the reason for the recovery request
  *
  * Call API only in case of fatal error,
  * if self_recovery_cb callback is registered, injcets fw crash and recovers
@@ -76,9 +77,10 @@ void qdf_register_self_recovery_callback(qdf_self_recovery_callback callback);
  *
  * Return: None
  */
-#define qdf_trigger_self_recovery() \
-	__qdf_trigger_self_recovery(__func__, __LINE__)
-void __qdf_trigger_self_recovery(const char *func, const uint32_t line);
+#define qdf_trigger_self_recovery(reason) \
+	__qdf_trigger_self_recovery(reason, __func__, __LINE__)
+void __qdf_trigger_self_recovery(enum qdf_hang_reason reason,
+				 const char *func, const uint32_t line);
 
 /**
  * qdf_is_recovering_callback() - callback to get driver recovering in progress

+ 12 - 10
qdf/inc/qdf_types.h

@@ -1164,16 +1164,17 @@ enum qdf_suspend_type {
 
 /**
  * enum qdf_hang_reason - host hang/ssr reason
- * @CDS_REASON_UNSPECIFIED: Unspecified reason
- * @CDS_RX_HASH_NO_ENTRY_FOUND: No Map for the MAC entry for the received frame
- * @CDS_PEER_DELETION_TIMEDOUT: peer deletion timeout happened
- * @CDS_PEER_UNMAP_TIMEDOUT: peer unmap timeout
- * @CDS_SCAN_REQ_EXPIRED: Scan request timed out
- * @CDS_SCAN_ATTEMPT_FAILURES: Consecutive Scan attempt failures
- * @CDS_GET_MSG_BUFF_FAILURE: Unable to get the message buffer
- * @CDS_ACTIVE_LIST_TIMEOUT: Current command processing is timedout
- * @CDS_SUSPEND_TIMEOUT: Timeout for an ACK from FW for suspend request
- * @CDS_RESUME_TIMEOUT: Timeout for an ACK from FW for resume request
+ * @QDF_REASON_UNSPECIFIED: Unspecified reason
+ * @QDF_RX_HASH_NO_ENTRY_FOUND: No Map for the MAC entry for the received frame
+ * @QDF_PEER_DELETION_TIMEDOUT: peer deletion timeout happened
+ * @QDF_PEER_UNMAP_TIMEDOUT: peer unmap timeout
+ * @QDF_SCAN_REQ_EXPIRED: Scan request timed out
+ * @QDF_SCAN_ATTEMPT_FAILURES: Consecutive Scan attempt failures
+ * @QDF_GET_MSG_BUFF_FAILURE: Unable to get the message buffer
+ * @QDF_ACTIVE_LIST_TIMEOUT: Current command processing is timedout
+ * @QDF_SUSPEND_TIMEOUT: Timeout for an ACK from FW for suspend request
+ * @QDF_RESUME_TIMEOUT: Timeout for an ACK from FW for resume request
+ * @QDF_WMI_EXCEED_MAX_PENDING_CMDS: wmi exceed max pending cmd
  */
 enum qdf_hang_reason {
 	QDF_REASON_UNSPECIFIED = 0,
@@ -1186,6 +1187,7 @@ enum qdf_hang_reason {
 	QDF_ACTIVE_LIST_TIMEOUT = 7,
 	QDF_SUSPEND_TIMEOUT = 8,
 	QDF_RESUME_TIMEOUT = 9,
+	QDF_WMI_EXCEED_MAX_PENDING_CMDS = 10,
 };
 
 /**

+ 3 - 2
qdf/src/qdf_platform.c

@@ -55,10 +55,11 @@ void qdf_register_self_recovery_callback(qdf_self_recovery_callback callback)
 
 qdf_export_symbol(qdf_register_self_recovery_callback);
 
-void __qdf_trigger_self_recovery(const char *func, const uint32_t line)
+void __qdf_trigger_self_recovery(enum qdf_hang_reason reason,
+				 const char *func, const uint32_t line)
 {
 	if (self_recovery_cb)
-		self_recovery_cb(QDF_REASON_UNSPECIFIED, func, line);
+		self_recovery_cb(reason, func, line);
 	else
 		QDF_DEBUG_PANIC_FL(func, line, "");
 }

+ 1 - 1
wmi/src/wmi_unified.c

@@ -1719,7 +1719,7 @@ QDF_STATUS wmi_unified_cmd_send_fl(wmi_unified_t wmi_handle, wmi_buf_t buf,
 		wmi_nofl_err("%s:%d, MAX %d WMI Pending cmds reached",
 			     func, line, wmi_handle->wmi_max_cmds);
 		wmi_unified_debug_dump(wmi_handle);
-		qdf_trigger_self_recovery();
+		qdf_trigger_self_recovery(QDF_WMI_EXCEED_MAX_PENDING_CMDS);
 		return QDF_STATUS_E_BUSY;
 	}