Browse Source

qcacld-3.0: Prevent runtime suspend when recovery initiated

qcacld-2.0 to qcacld-3.0 propagation

When self recovery initiated, CRASH_INJECT command is sent to
firmware. If firmware crash doesn't reach the host in time then
RuntimePM may kick in and try to suspend the PCIe link. At this
time, firmware might already been crashed just that host missed
the interrupt. Add the logic to prevent the Runtime suspend when
initiating the recovery so that host driver doesn't attempt the
suspend which may not go through and cause stability issues.

Change-Id: Ie8d5fc6aa08e4864fa5f03119c25037f5aeb5cec
CRs-fixed: 924538
Houston Hoffman 9 years ago
parent
commit
c7c72a8cc9
1 changed files with 16 additions and 5 deletions
  1. 16 5
      core/cds/src/cds_api.c

+ 16 - 5
core/cds/src/cds_api.c

@@ -1615,6 +1615,7 @@ void cds_trigger_recovery(void)
 {
 	tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	qdf_runtime_lock_t recovery_lock;
 
 	if (!wma_handle) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
@@ -1622,6 +1623,15 @@ void cds_trigger_recovery(void)
 		return;
 	}
 
+	recovery_lock = qdf_runtime_lock_init("cds_recovery");
+	if (!recovery_lock) {
+		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+			"Could not acquire runtime pm lock!");
+		return;
+	}
+
+	qdf_runtime_pm_prevent_suspend(recovery_lock);
+
 	wma_crash_inject(wma_handle, RECOVERY_SIM_SELF_RECOVERY, 0);
 
 	status = qdf_wait_single_event(&wma_handle->recovery_event,
@@ -1634,14 +1644,15 @@ void cds_trigger_recovery(void)
 		if (cds_is_driver_recovering()) {
 			QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 				"Recovery is in progress, ignore!");
-			return;
+		} else {
+			cds_set_recovery_in_progress(true);
+			cnss_schedule_recovery_work();
 		}
-		cds_set_recovery_in_progress(true);
-		cnss_schedule_recovery_work();
  #endif
-
-		return;
 	}
+
+	qdf_runtime_pm_allow_suspend(recovery_lock);
+	qdf_runtime_lock_deinit(recovery_lock);
 }
 
 /**