Эх сурвалжийг харах

qcacmn: Fix Runtime PM resume issue for ipci interface

For ipci interface platforms, currently RTPM resume is
requested from CE interrupt handler even when suspend
is in progress. But ideally we should request resume
only RTPM state is in suspended, since as part of suspend
sequence also we will get CE WOW events and this should
not trigger resume.

Fix this by requesting resume from CE interrupt handler
only when driver state is suspended.

Change-Id: I450d6c48809afae26fe863184766ab5141d25691
CRs-Fixed: 3554857
Karthik Kantamneni 1 жил өмнө
parent
commit
f243b44719

+ 8 - 4
hif/src/hif_runtime_pm.c

@@ -139,6 +139,12 @@ int hif_rtpm_log_debug_stats(void *s, enum hif_rtpm_fill_type type)
 	hif_rtpm_print(type, &index, s, "%30s: %llu\n", "Last Busy timestamp",
 		       gp_hif_rtpm_ctx->stats.last_busy_ts);
 
+	hif_rtpm_print(type, &index, s, "%30s: %llu\n", "Last resume request timestamp",
+		       gp_hif_rtpm_ctx->stats.request_resume_ts);
+
+	hif_rtpm_print(type, &index, s, "%30s: %d\n", "Last resume request by",
+		       gp_hif_rtpm_ctx->stats.request_resume_id);
+
 	hif_rtpm_print(type, &index, s, "%30s: %ps\n", "Last Busy Marker",
 		       gp_hif_rtpm_ctx->stats.last_busy_marker);
 
@@ -983,16 +989,14 @@ void hif_rtpm_request_resume(void)
 void hif_rtpm_check_and_request_resume(void)
 {
 	hif_rtpm_suspend_lock();
-	if (qdf_atomic_read(&gp_hif_rtpm_ctx->pm_state) >=
-			HIF_RTPM_STATE_SUSPENDING) {
+	if (qdf_atomic_read(&gp_hif_rtpm_ctx->pm_state) ==
+			HIF_RTPM_STATE_SUSPENDED) {
 		hif_rtpm_suspend_unlock();
 		__hif_rtpm_request_resume(gp_hif_rtpm_ctx->dev);
 		gp_hif_rtpm_ctx->stats.request_resume_ts =
 						qdf_get_log_timestamp();
 		gp_hif_rtpm_ctx->stats.request_resume_id = HIF_RTPM_ID_RESERVED;
 	} else {
-		__hif_rtpm_mark_last_busy(gp_hif_rtpm_ctx->dev);
-		gp_hif_rtpm_ctx->stats.last_busy_ts = qdf_get_log_timestamp();
 		hif_rtpm_suspend_unlock();
 	}
 }