فهرست منبع

qcacmn: Wait till EP vote is released after reg work completion

After reg work is complete there is possiblity EP vote reset
request still not processed by F.W. So wait till EP vote reset
is done after reg work completion.

Change-Id: I1f4e318ac96ba3a15c613c5faf5095d4be7c8e99
CRs-Fixed: 2994233
Karthik Kantamneni 4 سال پیش
والد
کامیت
7bf43ce817
2فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 2 0
      hif/inc/hif.h
  2. 13 0
      hif/src/hif_main.c

+ 2 - 0
hif/inc/hif.h

@@ -49,6 +49,8 @@ typedef void *hif_handle_t;
 
 #if defined(HIF_IPCI) && defined(FEATURE_HAL_DELAYED_REG_WRITE)
 #define HIF_WORK_DRAIN_WAIT_CNT 50
+
+#define HIF_EP_WAKE_RESET_WAIT_CNT 10
 #endif
 
 #define HIF_TYPE_AR6002   2

+ 13 - 0
hif/src/hif_main.c

@@ -52,6 +52,10 @@
 #endif
 #include <linux/cpumask.h>
 
+#if defined(HIF_IPCI) && defined(FEATURE_HAL_DELAYED_REG_WRITE)
+#include <pld_common.h>
+#endif
+
 void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t cmd_id, bool start)
 {
 	hif_trigger_dump(hif_ctx, cmd_id, start);
@@ -1043,6 +1047,7 @@ QDF_STATUS hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx)
 {
 	struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
 	uint32_t work_drain_wait_cnt = 0;
+	uint32_t wait_cnt = 0;
 	int work = 0;
 
 	qdf_atomic_set(&scn->dp_ep_vote_access,
@@ -1062,6 +1067,14 @@ QDF_STATUS hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx)
 		qdf_sleep(10);
 	}
 
+	while (pld_is_pci_ep_awake(scn->qdf_dev->dev)) {
+		if (++wait_cnt > HIF_EP_WAKE_RESET_WAIT_CNT) {
+			hif_err("Release EP vote is not proceed by Fw");
+			return QDF_STATUS_E_FAULT;
+		}
+		qdf_sleep(5);
+	}
+
 	return QDF_STATUS_SUCCESS;
 }