Forráskód Böngészése

qcacld-3.0: Trigger cds_recovery if suspend_resume fails

Trigger a cds_recovery as a error handling mechanism if
wlan suspend resume fails.

Change-Id: I36cfbc6c1e7820be1b60a73006f93e8a2926c98c
CRs-Fixed: 3632605
Aditya Kodukula 1 éve
szülő
commit
d39674846a
2 módosított fájl, 32 hozzáadás és 6 törlés
  1. 6 0
      core/hdd/inc/wlan_hdd_driver_ops.h
  2. 26 6
      core/hdd/src/wlan_hdd_driver_ops.c

+ 6 - 0
core/hdd/inc/wlan_hdd_driver_ops.h

@@ -22,9 +22,15 @@
 #define __WLAN_HDD_DRIVER_OPS_H__
 
 #include "hif.h"
+#include <qdf_types.h>
 
 struct hdd_context;
 
+#define wlan_hdd_trigger_cds_recovery(reason) \
+	__wlan_hdd_trigger_cds_recovery(reason, __func__, __LINE__)
+
+void __wlan_hdd_trigger_cds_recovery(enum qdf_hang_reason reason,
+				     const char *func, const uint32_t line);
 /**
  * DOC: wlan_hdd_driver_ops.h
  *

+ 26 - 6
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1278,6 +1278,12 @@ hdd_to_pmo_wow_enable_params(struct wow_enable_params *in_params,
 	return 0;
 }
 
+void __wlan_hdd_trigger_cds_recovery(enum qdf_hang_reason reason,
+				     const char *func, const uint32_t line)
+{
+	__cds_trigger_recovery(reason, func, line);
+}
+
 /**
  * __wlan_hdd_bus_suspend() - handles platform suspend
  * @wow_params: collection of wow enable override parameters
@@ -1406,26 +1412,40 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params,
 
 resume_txrx:
 	status = ucfg_pmo_core_txrx_resume(hdd_ctx->psoc);
-	QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wlan_hdd_trigger_cds_recovery(QDF_RESUME_TIMEOUT);
+		return qdf_status_to_os_return(status);
+	}
 
 resume_hif:
 	status = hif_bus_resume(hif_ctx);
-	QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wlan_hdd_trigger_cds_recovery(QDF_RESUME_TIMEOUT);
+		return qdf_status_to_os_return(status);
+	}
 
 resume_pmo:
 	status = ucfg_pmo_psoc_bus_resume_req(hdd_ctx->psoc,
 					      type);
-	QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wlan_hdd_trigger_cds_recovery(QDF_RESUME_TIMEOUT);
+		return qdf_status_to_os_return(status);
+	}
 
 late_hif_resume:
 	status = hif_bus_late_resume(hif_ctx);
-	QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wlan_hdd_trigger_cds_recovery(QDF_RESUME_TIMEOUT);
+		return qdf_status_to_os_return(status);
+	}
 
 resume_dp:
 	status = ucfg_dp_bus_resume(dp_soc, OL_TXRX_PDEV_ID);
-	QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wlan_hdd_trigger_cds_recovery(QDF_RESUME_TIMEOUT);
+		return qdf_status_to_os_return(status);
+	}
 	hif_system_pm_set_state_on(hif_ctx);
-
 	return err;
 }