Kaynağa Gözat

qcacld-3.0: Do not fail resume during recovery

If WLAN FW crashes while in suspend mode then resume fails.
Returning failure in this case confuses kernel power manager. Do
not return failure to resume if recovery is going on.

Also do not panic for the resume failures if recovery is going
on.

Change-Id: I380194cb53ca669edaf50544657b19b74de6dfd3
CRs-fixed: 1079299
(cherry picked from commit 3ff45a5b515810d36f36e2755a3653a55ab81a4a)
Prashanth Bhatta 8 yıl önce
ebeveyn
işleme
697dd0cd4e

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

@@ -650,8 +650,13 @@ static int __wlan_hdd_bus_resume(void)
 {
 	hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	void *hif_ctx;
-	int status = wlan_hdd_validate_context(hdd_ctx);
+	int status;
+	QDF_STATUS qdf_status;
+
+	if (cds_is_driver_recovering())
+		return 0;
 
+	status = wlan_hdd_validate_context(hdd_ctx);
 	if (status)
 		return status;
 
@@ -665,15 +670,28 @@ static int __wlan_hdd_bus_resume(void)
 		return -EINVAL;
 
 	status = hif_bus_resume(hif_ctx);
-	QDF_BUG(!status);
+	if (status)
+		goto out;
 
 	status = wma_bus_resume();
-	QDF_BUG(!status);
+	if (status)
+		goto out;
 
-	status = ol_txrx_bus_resume();
-	QDF_BUG(!status);
+	qdf_status = ol_txrx_bus_resume();
+	status = qdf_status_to_os_return(qdf_status);
+	if (status)
+		goto out;
 
 	hdd_info("resume done");
+
+	return 0;
+
+out:
+	if (cds_is_driver_recovering())
+		return 0;
+
+	QDF_BUG(false);
+
 	return status;
 }
 
@@ -701,8 +719,12 @@ static int __wlan_hdd_bus_resume_noirq(void)
 {
 	hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	void *hif_ctx;
-	int status = wlan_hdd_validate_context(hdd_ctx);
+	int status;
+
+	if (cds_is_driver_recovering())
+		return 0;
 
+	status = wlan_hdd_validate_context(hdd_ctx);
 	if (status) {
 		hdd_err("Invalid HDD context: %d", status);
 		return status;

+ 3 - 0
core/hdd/src/wlan_hdd_power.c

@@ -1729,6 +1729,9 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
 
 	ENTER();
 
+	if (cds_is_driver_recovering())
+		return 0;
+
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		hdd_err("Command not allowed in FTM mode");
 		return -EINVAL;