Ver Fonte

qcacld-3.0: Create and Destroy bug report lock over insmod and rmmod

Logging thread creates the bug report spinlock initially.
ifconfig thread tries to create the same spinlock
again, this leads to change in spinlock magic.

Create and Destroy the same lock on insmod/rmmod only.

CRs-Fixed: 2033886
Change-Id: Iea2fe4f9bd47b0d7f4ad1a176a361bac242b9d4d
SaidiReddy Yenuga há 8 anos atrás
pai
commit
699d90e4b0
3 ficheiros alterados com 44 adições e 28 exclusões
  1. 0 1
      core/cds/inc/cds_api.h
  2. 0 27
      core/cds/src/cds_api.c
  3. 44 0
      core/hdd/src/wlan_hdd_main.c

+ 0 - 1
core/cds/inc/cds_api.h

@@ -270,7 +270,6 @@ void cds_set_fatal_event(bool value);
 void cds_wlan_flush_host_logs_for_fatal(void);
 
 void cds_init_log_completion(void);
-void cds_deinit_log_completion(void);
 QDF_STATUS cds_flush_logs(uint32_t is_fatal,
 		uint32_t indicator,
 		uint32_t reason_code,

+ 0 - 27
core/cds/src/cds_api.c

@@ -1088,7 +1088,6 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc, v_CONTEXT_t cds_context)
 		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
 	}
 
-	cds_deinit_log_completion();
 	cds_deinit_ini_config();
 	qdf_timer_module_deinit();
 
@@ -1925,32 +1924,6 @@ void cds_init_log_completion(void)
 	p_cds_context->log_complete.indicator = WLAN_LOG_INDICATOR_UNUSED;
 	p_cds_context->log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED;
 	p_cds_context->log_complete.is_report_in_progress = false;
-	/* Attempting to initialize an already initialized lock
-	 * results in a failure. This must be ok here.
-	 */
-	qdf_spinlock_create(&p_cds_context->bug_report_lock);
-}
-
-/**
- * cds_deinit_log_completion() - Deinitialize log param structure
- *
- * This function is used to deinitialize the logging related
- * parameters
- *
- * Return: None
- */
-void cds_deinit_log_completion(void)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return;
-	}
-
-	qdf_spinlock_destroy(&p_cds_context->bug_report_lock);
 }
 
 /**

+ 44 - 0
core/hdd/src/wlan_hdd_main.c

@@ -5334,6 +5334,26 @@ static void hdd_context_destroy(hdd_context_t *hdd_ctx)
 	wiphy_free(hdd_ctx->wiphy);
 }
 
+/**
+ * wlan_destroy_bug_report_lock() - Destroy bug report lock
+ *
+ * This function is used to destroy bug report lock
+ *
+ * Return: None
+ */
+static void wlan_destroy_bug_report_lock(void)
+{
+	p_cds_contextType p_cds_context;
+
+	p_cds_context = cds_get_global_context();
+	if (!p_cds_context) {
+		hdd_err("cds context is NULL");
+		return;
+	}
+
+	qdf_spinlock_destroy(&p_cds_context->bug_report_lock);
+}
+
 /**
  * hdd_wlan_exit() - HDD WLAN exit function
  * @hdd_ctx:	Pointer to the HDD Context
@@ -5420,6 +5440,8 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx)
 		hdd_stop_all_adapters(hdd_ctx);
 	}
 
+	wlan_destroy_bug_report_lock();
+
 	/*
 	 * Close the scheduler before calling cds_close to make sure
 	 * no thread is scheduled after the each module close is
@@ -9083,6 +9105,26 @@ static void hdd_register_debug_callback(void)
 	qdf_register_debug_callback(QDF_MODULE_ID_HDD, &hdd_state_info_dump);
 }
 
+/*
+ * wlan_init_bug_report_lock() - Initialize bug report lock
+ *
+ * This function is used to create bug report lock
+ *
+ * Return: None
+ */
+static void wlan_init_bug_report_lock(void)
+{
+	p_cds_contextType p_cds_context;
+
+	p_cds_context = cds_get_global_context();
+	if (!p_cds_context) {
+		hdd_err("cds context is NULL");
+		return;
+	}
+
+	qdf_spinlock_create(&p_cds_context->bug_report_lock);
+}
+
 /**
  * hdd_wlan_startup() - HDD init function
  * @dev:	Pointer to the underlying device
@@ -9132,6 +9174,8 @@ int hdd_wlan_startup(struct device *dev)
 		goto err_exit_nl_srv;
 	}
 
+	wlan_init_bug_report_lock();
+
 	wlan_hdd_update_wiphy(hdd_ctx);
 
 	if (0 != wlan_hdd_set_wow_pulse(hdd_ctx, true))