Prechádzať zdrojové kódy

qcacld-3.0: IPA SMMU enable check to be moved to IPA ready cb

During probe IPA SMMU S1 enable check will pass only if IPA
registration for ready callback is successful and IPA ready
callback is invoked.
This ensures that IPA APIs are not invoked unless IPA ready
callback is invoked and ipa ready flag is set in the host
driver.

Change-Id: Ie157a2f851bb1e914a098b62ede1280aa0243d19
CRs-Fixed: 2778504
Nisha Menon 4 rokov pred
rodič
commit
417b7e3c6f

+ 18 - 0
components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h

@@ -42,6 +42,19 @@
  */
 bool ucfg_ipa_is_present(void);
 
+/**
+ * ucfg_ipa_is_ready() - get IPA ready status
+ *
+ * After ipa_ready_cb() is registered and later invoked by IPA
+ * driver, ipa ready status flag is updated in wlan driver.
+ * Unless IPA ready callback is invoked and ready status is
+ * updated none of the IPA APIs should be invoked.
+ *
+ * Return: true - ipa is ready
+ *         false - ipa is not ready
+ */
+bool ucfg_ipa_is_ready(void);
+
 /**
  * ucfg_ipa_is_enabled() - get IPA enable status
  *
@@ -397,6 +410,11 @@ static inline bool ucfg_ipa_is_present(void)
 	return false;
 }
 
+static inline bool ucfg_ipa_is_ready(void)
+{
+	return false;
+}
+
 static inline void ucfg_ipa_update_config(struct wlan_ipa_config *config)
 {
 }

+ 5 - 0
components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c

@@ -29,6 +29,11 @@ bool ucfg_ipa_is_present(void)
 	return ipa_is_hw_support();
 }
 
+bool ucfg_ipa_is_ready(void)
+{
+	return ipa_is_ready();
+}
+
 bool ucfg_ipa_is_enabled(void)
 {
 	return ipa_config_is_enabled();

+ 1 - 1
core/hdd/src/wlan_hdd_driver_ops.c

@@ -405,7 +405,7 @@ static int hdd_init_qdf_ctx(struct device *dev, void *bdev,
 	qdf_dev->bus_type = bus_type;
 	qdf_dev->bid = bid;
 
-	if (cds_smmu_mem_map_setup(qdf_dev, ucfg_ipa_is_present()) !=
+	if (cds_smmu_mem_map_setup(qdf_dev, ucfg_ipa_is_ready()) !=
 		QDF_STATUS_SUCCESS) {
 		hdd_err("cds_smmu_mem_map_setup() failed");
 		return -EFAULT;