qcacld-3.0: Check if pipes already enabled for IPA enable pipes

Currently there is a race condition during enable of IPA WDI pipes
after IPA_RM_RESOURCE_GRANTED notification from IPA RM and at the
same time client disconnect happens. Because of this race condition
subsequent enable IPA pipes at the time of client connection IPA
driver returns error as the pipes are not disabled before. In this
change after requesting IPA resource check for IPA pipes state and
if pipes are not enabled then enable the pipes.

Change-Id: Idd0d4089efa5b81d5301a278fb0dd836db0ecb48
CRs-Fixed: 2082118
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index dc15de8..d87872d 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -1921,12 +1921,23 @@
 			/* RM PROD request sync return
 			 * enable pipe immediately
 			 */
+			if (!hdd_ipa->ipa_pipes_down) {
+				HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG,
+					"%s: IPA WDI Pipe already activated",
+					__func__);
+				return 0;
+			}
+
 			if (hdd_ipa_uc_enable_pipes(hdd_ipa)) {
 				HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
 					"IPA WDI Pipe activation failed");
 				hdd_ipa->resource_loading = false;
 				return -EBUSY;
 			}
+		} else {
+			HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO,
+				    "%s: IPA WDI Pipe activation deferred",
+					__func__);
 		}
 	} else {
 		/* RM Disabled