summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Khandavalli <akhandav@codeaurora.org>2017-03-13 17:29:12 +0530
committerPrashanth Bhatta <bhattap@codeaurora.org>2017-03-13 18:10:15 -0700
commitfc0992b6e61a14419a7d7b9154fe418348c02840 (patch)
treefd8b4e5361435139bf0ef4a0b6aceea06ac57d47
parent9b79d003495aab152218760ccebd7a1b3584838a (diff)
qcacld-3.0: Depending on the target type trigger self-recovery
Triggering the self-recovery is different for the different type of targets supported. Depending on the target type trigger the self-recovery through the platform driver over QMI or through CRASH_INJECT, Also While triggering the recovery from logging thread check if the self-recovery is supported CRs-Fixed: 2017514 Change-Id: I788e4280276d83a1d74bd98e7b2e12e3002dfe78
-rw-r--r--core/cds/src/cds_api.c54
-rw-r--r--core/utils/logging/src/wlan_logging_sock_svc.c16
2 files changed, 56 insertions, 14 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index 710cf83ba3b3..a53d0ff021a0 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -1651,6 +1651,50 @@ bool cds_is_packet_log_enabled(void)
return pHddCtx->config->enablePacketLog;
}
+#ifdef QCA_WIFI_3_0_ADRASTEA
+/**
+ * cds_force_assert_target() - Force target assert via platform
+ * driver
+ * @qdf_ctx: pointer of qdf context
+ *
+ * For ADRASTREA chipsets target assert is supported via platform driver,
+ * for ROME chipsets control of self-recovery is with the hostdriver.
+ *
+ * Return: QDF_STATUS_SUCCESS if target assert through firmware is supported
+ * QDF_STATUS_E_INVAL if targer assert through firmware failed
+ * QDF_STATUS_E_NOSUPPORT if not supported for target
+ */
+static QDF_STATUS cds_force_assert_target(qdf_device_t qdf_ctx)
+{
+
+ cds_set_recovery_in_progress(true);
+ /*
+ * If force assert thru platform is available, trigger that interface.
+ * That should generate recovery by going thru the normal FW
+ * assert recovery model.
+ */
+ if (!pld_force_assert_target(qdf_ctx->dev)) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
+ "Force assert triggered");
+ return QDF_STATUS_SUCCESS;
+ }
+
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "Self Recovery not supported via Platform driver assert");
+
+ cds_set_recovery_in_progress(false);
+ QDF_BUG(0);
+
+ return QDF_STATUS_E_INVAL;
+}
+
+#else
+static QDF_STATUS cds_force_assert_target(qdf_device_t qdf_ctx)
+{
+ return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
+
/**
* cds_config_recovery_work() - configure self recovery
* @qdf_ctx: pointer of qdf context
@@ -1704,16 +1748,8 @@ void cds_trigger_recovery(bool skip_crash_inject)
qdf_runtime_pm_prevent_suspend(&recovery_lock);
- /*
- * If force assert thru platform is available, trigger that interface.
- * That should generate recovery by going thru the normal FW
- * assert recovery model.
- */
- if (!pld_force_assert_target(qdf_ctx->dev)) {
- QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
- "Force assert triggered");
+ if (QDF_STATUS_E_NOSUPPORT != cds_force_assert_target(qdf_ctx))
goto out;
- }
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"Force assert not available at platform");
diff --git a/core/utils/logging/src/wlan_logging_sock_svc.c b/core/utils/logging/src/wlan_logging_sock_svc.c
index bc6eb295432e..b8bf6fb7fc10 100644
--- a/core/utils/logging/src/wlan_logging_sock_svc.c
+++ b/core/utils/logging/src/wlan_logging_sock_svc.c
@@ -736,19 +736,25 @@ void wlan_report_log_completion(uint32_t is_fatal,
static void send_flush_completion_to_user(void)
{
uint32_t is_fatal, indicator, reason_code;
- bool recovery_needed;
+ bool recovery_needed = false;
- cds_get_and_reset_log_completion(&is_fatal,
- &indicator, &reason_code, &recovery_needed);
+ cds_get_and_reset_log_completion(&is_fatal, &indicator, &reason_code,
+ &recovery_needed);
/* Error on purpose, so that it will get logged in the kmsg */
LOGGING_TRACE(QDF_TRACE_LEVEL_DEBUG,
- "%s: Sending flush done to userspace", __func__);
+ "%s: Sending flush done to userspace, recovery: %d",
+ __func__, recovery_needed);
wlan_report_log_completion(is_fatal, indicator, reason_code);
- if (recovery_needed)
+ if (!recovery_needed)
+ return;
+
+ if (cds_is_self_recovery_enabled())
cds_trigger_recovery(false);
+ else
+ QDF_BUG(0);
}
/**