Jelajahi Sumber

qcacld-3.0: Complete resume if FW crashed

If WLAN FW crashes while in suspend mode then kernel tries to
resume the driver and WMA sends resume indication to WLAN FW and
waits for the response from WLAN FW. Since FW is already crashed,
there will not be any response from WLAN FW and wait logic waits
for the timeout before bailing out. This may cause delay in
completing the recovery and may cause other race conditions
becuase of that.

Register for shutdown notification so that call back would be
called during recovery and resume event can be set to make sure
resume thread doesn't just wait for the FW response.

Change-Id: Icdd78479dd4072eabf29e7b0664d328553bfa1ad
CRs-fixed: 1079299
(cherry picked from commit 9e493ade1c08204fcfff51c66d135803d830fa60)
Prashanth Bhatta 8 tahun lalu
induk
melakukan
e675ca784d
1 mengubah file dengan 27 tambahan dan 0 penghapusan
  1. 27 0
      core/wma/src/wma_main.c

+ 27 - 0
core/wma/src/wma_main.c

@@ -1672,6 +1672,25 @@ static void wma_init_max_no_of_peers(tp_wma_handle wma_handle,
 	cfg->max_no_of_peers = max_peers;
 }
 
+/**
+ * wma_shutdown_notifier_cb - Shutdown notifer call back
+ * @priv : WMA handle
+ *
+ * During recovery, WMA may wait for resume to complete if the crash happens
+ * while in suspend. This may cause delays in completing the recovery. This call
+ * back would be called during recovery and the event is completed so that if
+ * the resume is waiting on FW to respond then it can get out of the wait so
+ * that recovery thread can start bringing down all the modules.
+ *
+ * Return: None
+ */
+static void wma_shutdown_notifier_cb(void *priv)
+{
+	tp_wma_handle wma_handle = priv;
+
+	qdf_event_set(&wma_handle->wma_resume_event);
+}
+
 struct wma_version_info g_wmi_version_info;
 
 /**
@@ -2097,6 +2116,14 @@ QDF_STATUS wma_open(void *cds_context,
 		goto err_event_init;
 	}
 
+	qdf_status = cds_shutdown_notifier_register(wma_shutdown_notifier_cb,
+						    wma_handle);
+	if (qdf_status != QDF_STATUS_SUCCESS) {
+		WMA_LOGP("%s: Shutdown notifier register failed: %d",
+			 __func__, qdf_status);
+		goto err_event_init;
+	}
+
 	qdf_status = qdf_event_create(&wma_handle->runtime_suspend);
 	if (qdf_status != QDF_STATUS_SUCCESS) {
 		WMA_LOGP("%s: runtime_suspend event initialization failed",