ソースを参照

qcacmn: Add support to request rtpm resume in suspending state

Add support to request rtpm resume in suspending state,
this helps to request resume from WOW initial wake up
sequence if resume request is being missed from CE
interrupt handler.

Change-Id: I7e5e4be7d793fef94c7c72f9c3bd2ac28e992f7c
CRs-Fixed: 3743772
Karthik Kantamneni 1 年間 前
コミット
5bce59c56f
3 ファイル変更13 行追加10 行削除
  1. 3 2
      hif/inc/hif.h
  2. 8 6
      hif/src/hif_runtime_pm.c
  3. 2 2
      hif/src/ipcie/if_ipci.c

+ 3 - 2
hif/inc/hif.h

@@ -1588,10 +1588,11 @@ QDF_STATUS hif_rtpm_sync_resume(void);
 /**
  * hif_rtpm_check_and_request_resume() - check if bus is suspended and
  *                                       request resume.
+ * @suspend_in_progress: Request resume if suspend is in progress
  *
  * Return: void
  */
-void hif_rtpm_check_and_request_resume(void);
+void hif_rtpm_check_and_request_resume(bool suspend_in_progress);
 
 /**
  * hif_rtpm_set_client_job() - Set job for the client.
@@ -1852,7 +1853,7 @@ void hif_rtpm_request_resume(void)
 {}
 
 static inline
-void hif_rtpm_check_and_request_resume(void)
+void hif_rtpm_check_and_request_resume(bool suspend_in_progress)
 {}
 
 static inline

+ 8 - 6
hif/src/hif_runtime_pm.c

@@ -992,18 +992,20 @@ void hif_rtpm_request_resume(void)
 	hif_info_high("request RTPM resume %s", (char *)_RET_IP_);
 }
 
-void hif_rtpm_check_and_request_resume(void)
+void hif_rtpm_check_and_request_resume(bool suspend_in_progress)
 {
+	enum hif_rtpm_state state;
+
 	hif_rtpm_suspend_lock();
-	if (qdf_atomic_read(&gp_hif_rtpm_ctx->pm_state) ==
-			HIF_RTPM_STATE_SUSPENDED) {
-		hif_rtpm_suspend_unlock();
+	state = qdf_atomic_read(&gp_hif_rtpm_ctx->pm_state);
+	hif_rtpm_suspend_unlock();
+
+	if ((state == HIF_RTPM_STATE_SUSPENDED) ||
+	    (suspend_in_progress && (state == HIF_RTPM_STATE_SUSPENDING))) {
 		__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_suspend_unlock();
 	}
 }
 

+ 2 - 2
hif/src/ipcie/if_ipci.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -408,7 +408,7 @@ static irqreturn_t hif_ce_interrupt_handler(int irq, void *context)
 {
 	struct ce_tasklet_entry *tasklet_entry = context;
 
-	hif_rtpm_check_and_request_resume();
+	hif_rtpm_check_and_request_resume(false);
 	return ce_dispatch_interrupt(tasklet_entry->ce_id, tasklet_entry);
 }