From 417b7e3c6f1eb0cec208849a37cc091e73517dad Mon Sep 17 00:00:00 2001 From: Nisha Menon Date: Wed, 16 Sep 2020 18:11:23 -0700 Subject: [PATCH] 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 --- .../ipa/dispatcher/inc/wlan_ipa_ucfg_api.h | 18 ++++++++++++++++++ .../ipa/dispatcher/src/wlan_ipa_ucfg_api.c | 5 +++++ core/hdd/src/wlan_hdd_driver_ops.c | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h b/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h index b03330dfecaa..61487bc3400a 100644 --- a/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h +++ b/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) { } diff --git a/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c b/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c index 2ef3d1c2b726..30c2ef1dc548 100644 --- a/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c +++ b/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(); diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 087cc256391d..6046872f285c 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/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;