From 789b6b32c729b3e18fc92b2a62778129514afb5c Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Mon, 15 Apr 2019 13:05:10 +0530 Subject: [PATCH] qcacld-3.0: add IPA cleanup during PD Restart Currently there is no way to find out PD Restart indication, so platform driver has added an API to differentiate PD Restart from SSR. Using this API in shutdown notify handler, sending message to IPA to do required cleanup. Change-Id: I9d07c6fc573b6db1c7d0c1b7c99f325e22fe81cd CRs-Fixed: 2436036 --- core/hdd/src/wlan_hdd_driver_ops.c | 3 ++- core/pld/inc/pld_common.h | 11 +++++++++++ core/pld/src/pld_common.c | 15 +++++++++++++++ core/pld/src/pld_snoc.h | 10 ++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 83a96a9f6fd4..e68603165869 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -693,7 +693,8 @@ static void hdd_psoc_shutdown_notify(struct hdd_context *hdd_ctx) if (ucfg_ipa_is_enabled()) { ucfg_ipa_uc_force_pipe_shutdown(hdd_ctx->pdev); - if (pld_is_fw_rejuvenate(hdd_ctx->parent_dev)) + if (pld_is_fw_rejuvenate(hdd_ctx->parent_dev) || + pld_is_pdr(hdd_ctx->parent_dev)) ucfg_ipa_fw_rejuvenate_send_msg(hdd_ctx->pdev); } diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 20922ea3617a..63885a50fd5c 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -614,6 +614,17 @@ int pld_force_assert_target(struct device *dev); int pld_collect_rddm(struct device *dev); bool pld_is_fw_dump_skipped(struct device *dev); +/** + * pld_is_pdr() - Check WLAN PD is Restarted + * + * Help the driver decide whether FW down is due to + * WLAN PD Restart. + * + * Return: 1 WLAN PD is Restarted + * 0 WLAN PD is not Restarted + */ +int pld_is_pdr(struct device *dev); + /** * pld_is_fw_rejuvenate() - Check WLAN fw is rejuvenating * diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 3cc79b7211a6..8eb3cf3e8edf 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1722,6 +1722,21 @@ bool pld_is_fw_dump_skipped(struct device *dev) return ret; } +int pld_is_pdr(struct device *dev) +{ + int ret = 0; + enum pld_bus_type type = pld_get_bus_type(dev); + + switch (type) { + case PLD_BUS_TYPE_SNOC: + ret = pld_snoc_is_pdr(); + break; + default: + break; + } + return ret; +} + int pld_is_fw_rejuvenate(struct device *dev) { int ret = 0; diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index be182dd412bb..9eef1ff4f5cb 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -127,6 +127,11 @@ static inline int pld_snoc_force_assert_target(struct device *dev) return 0; } +static inline int pld_snoc_is_pdr(void) +{ + return 0; +} + static inline int pld_snoc_is_fw_rejuvenate(void) { return 0; @@ -254,6 +259,11 @@ static inline int pld_snoc_force_assert_target(struct device *dev) return icnss_trigger_recovery(dev); } +static inline int pld_snoc_is_pdr(void) +{ + return icnss_is_pdr(); +} + static inline int pld_snoc_is_fw_rejuvenate(void) { return icnss_is_rejuvenate();