Browse Source

msm: ipa3: Adding chnages to update event RP from DDR

In suspend scenario while checking channel empty scenario
updating the event ring RP pointer from direct register, it
may cause mismatch in reading in polling context. To avoid
discrepancy  reading RP pointer DDR location.

Change-Id: Ie198ea9ace033e31463acd974f10dccdcac45c55
Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
Ashok Vuyyuru 4 years ago
parent
commit
9ea98412c7
1 changed files with 6 additions and 2 deletions
  1. 6 2
      drivers/platform/msm/gsi/gsi.c

+ 6 - 2
drivers/platform/msm/gsi/gsi.c

@@ -3654,6 +3654,7 @@ EXPORT_SYMBOL(gsi_query_channel_info);
 int gsi_is_channel_empty(unsigned long chan_hdl, bool *is_empty)
 {
 	struct gsi_chan_ctx *ctx;
+	struct gsi_evt_ctx *ev_ctx;
 	spinlock_t *slock;
 	unsigned long flags;
 	uint64_t rp;
@@ -3689,8 +3690,11 @@ int gsi_is_channel_empty(unsigned long chan_hdl, bool *is_empty)
 	spin_lock_irqsave(slock, flags);
 
 	if (ctx->props.dir == GSI_CHAN_DIR_FROM_GSI && ctx->evtr) {
-		rp = gsihal_read_reg_nk(GSI_EE_n_EV_CH_k_CNTXT_4,
-			ee, ctx->evtr->id);
+		ev_ctx = &gsi_ctx->evtr[ctx->evtr->id];
+		/* Read the event ring rp from DDR to avoid mismatch */
+		rp = ev_ctx->props.gsi_read_event_ring_rp(&ev_ctx->props,
+					ev_ctx->id, ee);
+
 		rp |= ctx->evtr->ring.rp & GSI_MSB_MASK;
 		ctx->evtr->ring.rp = rp;