summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArunk Khandavalli <akhandav@codeaurora.org>2016-12-15 15:15:04 +0530
committerAshish kumar goswami <agoswa@codeaurora.org>2016-12-16 18:02:01 +0530
commitc9ea2a7d0009f01cd7c6957370f701abb32b4f82 (patch)
tree373e298f36769fcb5c798aee17a03f4883766d53
parent53040f2c07f7e35b9165467f719f7291a7510e81 (diff)
qcacld-2.0: Use wrapper to reset the log_completion variables
Presently, vos_init_log_completion is used to reset the log_completion variables, which also initializes the spin_lock along with setting the log_completion variables to default. In case of SMP platforms, spin_lock would have been acquired on the different CPU and on the different CPU if the spin_lock is initialized again, it would change the magic of lock. So, the spin_lock acquired on CPU0 while releasing would result in error, since the magic content of the lock is changed by re-initializing without unlocking the spin_lock. use a wrapper function just to reset the log_completion variables to default Change-Id: I2c6754b41d05707103f1c39248829ba6033bfc4f CRs-Fixed: 1101839
-rw-r--r--CORE/VOSS/src/vos_api.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index 7bad9fc1cdf2..52072a3fccb5 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -2657,6 +2657,26 @@ uint8_t vos_is_multicast_logging(void)
}
/*
+ * vos_reset_log_completion() - Reset log param structure
+ *@vos_context: Pointer to global vos context
+ *
+ * This function is used to reset the logging related
+ * parameters to default.
+ *
+ * Return: None
+ */
+void vos_reset_log_completion(VosContextType *vos_context)
+{
+ /* Vos Context is validated by the caller */
+ vos_spin_lock_acquire(&vos_context->bug_report_lock);
+ vos_context->log_complete.indicator = WLAN_LOG_INDICATOR_UNUSED;
+ vos_context->log_complete.is_fatal = WLAN_LOG_TYPE_NON_FATAL;
+ vos_context->log_complete.is_report_in_progress = false;
+ vos_context->log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED;
+ vos_spin_lock_release(&vos_context->bug_report_lock);
+}
+
+/*
* vos_init_log_completion() - Initialize log param structure
*
* This function is used to initialize the logging related
@@ -2679,9 +2699,7 @@ void vos_init_log_completion(void)
vos_context->log_complete.indicator = WLAN_LOG_INDICATOR_UNUSED;
vos_context->log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED;
vos_context->log_complete.is_report_in_progress = false;
- /* Attempting to initialize an already initialized lock
- * results in a failure. This must be ok here.
- */
+
vos_spin_lock_init(&vos_context->bug_report_lock);
}
@@ -2779,12 +2797,9 @@ void vos_get_log_and_reset_completion(uint32_t *is_fatal,
else
*is_ssr_needed = false;
- /* reset */
- vos_context->log_complete.indicator = WLAN_LOG_INDICATOR_UNUSED;
- vos_context->log_complete.is_fatal = WLAN_LOG_TYPE_NON_FATAL;
- vos_context->log_complete.is_report_in_progress = false;
- vos_context->log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED;
vos_spin_lock_release(&vos_context->bug_report_lock);
+
+ vos_reset_log_completion(vos_context);
}
/**
@@ -2951,7 +2966,7 @@ VOS_STATUS vos_flush_logs(uint32_t is_fatal,
if (0 != ret) {
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"%s: Failed to send flush FW log", __func__);
- vos_init_log_completion();
+ vos_reset_log_completion(vos_context);
return VOS_STATUS_E_FAILURE;
}