summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Ouyang <yuo@codeaurora.org>2019-07-10 14:54:33 +0800
committerYu Ouyang <yuo@codeaurora.org>2019-07-19 16:00:06 +0800
commit58c4d2de424dee16d2774a0e875a31062f651fbf (patch)
tree7537c35089ad4411cd3e4d22a93a40ea0cc29bd4
parent5bfa42a4287c4cc140a2e877ab503841ac6cc4c7 (diff)
qcacld-2.0: Send user space about FW CRASHED indication
In function ol_target_failure(), if enable_self_recovery is true, fw_indication_work_handler() will be called. Ramdump collection will not be executed. But for no CNSS module platform, recovery flag is neither cleaned, no any FW indication is sent to user space. Even enable_self_recovery is false, no FW crashed indication sent to user space. So, add new function vos_svc_fw_crashed_ind() to send FW CRASHED IND to user space, and clean recovery flag. Change-Id: Idd76f2e1045353a95e0a902a9480169187b452f7 CRs-Fixed: 2487139
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h1
-rw-r--r--CORE/HDD/src/wlan_hdd_early_suspend.c27
-rw-r--r--CORE/SERVICES/BMI/ol_fw.c13
-rw-r--r--CORE/VOSS/inc/vos_api.h1
-rw-r--r--CORE/VOSS/src/vos_api.c14
5 files changed, 54 insertions, 2 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 1e092c82a838..c5bf533f9e79 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -2726,6 +2726,7 @@ void hdd_sap_restart_handle(struct work_struct *work);
void hdd_set_rps_cpu_mask(hdd_context_t *hdd_ctx);
void hdd_initialize_adapter_common(hdd_adapter_t *adapter);
void hdd_svc_fw_shutdown_ind(struct device *dev);
+void hdd_svc_fw_crashed_ind(struct device *dev);
void wlan_hdd_stop_enter_lowpower(hdd_context_t *hdd_ctx);
void wlan_hdd_init_chan_info(hdd_context_t *hdd_ctx);
void wlan_hdd_deinit_chan_info(hdd_context_t *hdd_ctx);
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 52fc13cdc74f..0a18fe9c641f 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -2029,6 +2029,31 @@ void hdd_svc_fw_shutdown_ind(struct device *dev)
NULL, 0) : 0;
}
+/**
+ * hdd_svc_fw_crashed_ind() - API to send FW CRASHED IND to Userspace
+ *
+ * @dev: Device Pointer
+ *
+ * Return: None
+ */
+void hdd_svc_fw_crashed_ind(struct device *dev)
+{
+ v_CONTEXT_t g_context;
+ hdd_context_t *hdd_ctx;
+
+ g_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL);
+
+ if(!g_context)
+ return;
+
+ hdd_ctx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD,
+ g_context);
+
+ hdd_ctx ? wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index,
+ WLAN_SVC_FW_CRASHED_IND,
+ NULL, 0) : 0;
+}
+
#ifdef FEATURE_WLAN_DIAG_SUPPORT
/**
* hdd_wlan_ssr_shutdown_event() - Send ssr shutdown status
diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c
index 3ca65adb8f7f..dcd6ed8fd26d 100644
--- a/CORE/SERVICES/BMI/ol_fw.c
+++ b/CORE/SERVICES/BMI/ol_fw.c
@@ -1194,6 +1194,11 @@ static void ramdump_work_handler(struct work_struct *ramdump)
#if !defined(HIF_SDIO)
ol_copy_ramdump(ramdump_scn);
vos_device_crashed(dev);
+#ifdef TARGET_DUMP_FOR_NON_QC_PLATFORM
+ vos_svc_fw_crashed_ind(dev);
+#endif
+ vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE);
+
return;
#endif
goto out_fail;
@@ -1273,6 +1278,9 @@ out_fail:
#endif
#endif
+#ifdef TARGET_DUMP_FOR_NON_QC_PLATFORM
+ vos_svc_fw_crashed_ind(dev);
+#endif
vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE);
return;
}
@@ -1299,6 +1307,11 @@ static void fw_indication_work_handler(struct work_struct *fw_indication)
}
vos_device_self_recovery(dev);
+
+#ifdef CONFIG_NON_QC_PLATFORM
+ vos_svc_fw_crashed_ind(dev);
+#endif
+ vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE);
}
static DECLARE_WORK(fw_indication_work, fw_indication_work_handler);
diff --git a/CORE/VOSS/inc/vos_api.h b/CORE/VOSS/inc/vos_api.h
index 7f457359c661..0d72908a0cd8 100644
--- a/CORE/VOSS/inc/vos_api.h
+++ b/CORE/VOSS/inc/vos_api.h
@@ -442,6 +442,7 @@ void vos_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data);
int vos_get_radio_index(void);
int vos_set_radio_index(int radio_index);
void vos_svc_fw_shutdown_ind(struct device *dev);
+void vos_svc_fw_crashed_ind(struct device *dev);
uint64_t vos_do_div(uint64_t, uint32_t);
/**
* vos_do_div64() - Do uint64/64 divsion.
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index 3d24490cb648..a33ae372c6d5 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -3368,7 +3368,7 @@ int vos_set_radio_index(int radio_index)
}
/**
- * vos_svc_fw_shutdown_ind() - API to send userspace about FW crash
+ * vos_svc_fw_shutdown_ind() - API to send userspace about FW shutdown
*
* @data: Device Pointer
*
@@ -3379,6 +3379,18 @@ void vos_svc_fw_shutdown_ind(struct device *dev)
hdd_svc_fw_shutdown_ind(dev);
}
+/**
+ * vos_svc_fw_shutdown_ind() - API to send userspace about FW crashed
+ *
+ * @data: Device Pointer
+ *
+ * Return: None
+*/
+void vos_svc_fw_crashed_ind(struct device *dev)
+{
+ hdd_svc_fw_crashed_ind(dev);
+}
+
v_U64_t vos_get_monotonic_boottime_ns(void)
{
struct timespec ts;