Selaa lähdekoodia

msm: ipa: remove condition to avoid crash in wrap around case

Rbase ptr and wp can be same in wrap around case, due to which
channel allocation fails and crash occurs.

Change-Id: I3546d77a0c41ea3fc5c86703bc79e6932af35404
Signed-off-by: Armaan Siddiqui <[email protected]>
Signed-off-by: Michael Adisumarta <[email protected]>
Michael Adisumarta 3 vuotta sitten
vanhempi
sitoutus
a723c6dc69
1 muutettua tiedostoa jossa 6 lisäystä ja 5 poistoa
  1. 6 5
      drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c

+ 6 - 5
drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c

@@ -262,11 +262,12 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
 		ep->gsi_evt_ring_hdl = *params->cached_gsi_evt_ring_hdl;
 	}
 
-	if (params->ev_ctx_host->wp == params->ev_ctx_host->rbase) {
-		IPA_MHI_ERR("event ring wp is not updated. base=wp=0x%llx\n",
-			params->ev_ctx_host->wp);
-		goto fail_alloc_ch;
-	}
+	/**
+	 * compare host evt ring wp with base ptr condition was added to check
+	 * whether MHI driver ring db or not, but in wrap around case wp and
+	 * base ptr can be same so removing it.
+	 * if evt-ring has no credit, gsi will crash.
+	 */
 
 	IPA_MHI_DBG("Ring event db: evt_ring_hdl=%lu host_wp=0x%llx\n",
 		ep->gsi_evt_ring_hdl, params->ev_ctx_host->wp);