Browse Source

qcacmn: Add credit history into the minidump

As part of minidump enhancement feature, incorporate
credit_history data structure into the minidump.

Change-Id: I66a899f6d4054677f25453e87ebf672a575e1b9a
CRs-Fixed: 2946301
Aditya Kodukula 4 years ago
parent
commit
45daa78c52
3 changed files with 30 additions and 9 deletions
  1. 1 0
      htc/htc.c
  2. 7 0
      htc/htc_credit_history.c
  3. 22 9
      htc/htc_credit_history.h

+ 1 - 0
htc/htc.c

@@ -435,6 +435,7 @@ void htc_destroy(HTC_HANDLE HTCHandle)
 	if (target)
 	if (target)
 		htc_cleanup(target);
 		htc_cleanup(target);
 	AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-htc_destroy\n"));
 	AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-htc_destroy\n"));
+	htc_credit_history_deinit();
 }
 }
 
 
 /* get the low level HIF device for the caller , the caller may wish to do low
 /* get the low level HIF device for the caller , the caller may wish to do low

+ 7 - 0
htc/htc_credit_history.c

@@ -60,11 +60,18 @@ static inline void htc_add_emulation_delay(void)
 }
 }
 #endif
 #endif
 
 
+void htc_credit_history_deinit(void)
+{
+	qdf_minidump_remove(&htc_credit_history_buffer,
+			    sizeof(htc_credit_history_buffer), "htc_credit");
+}
 void htc_credit_history_init(void)
 void htc_credit_history_init(void)
 {
 {
 	qdf_spinlock_create(&g_htc_credit_lock);
 	qdf_spinlock_create(&g_htc_credit_lock);
 	g_htc_credit_history_idx = 0;
 	g_htc_credit_history_idx = 0;
 	g_htc_credit_history_length = 0;
 	g_htc_credit_history_length = 0;
+	qdf_minidump_log(&htc_credit_history_buffer,
+			 sizeof(htc_credit_history_buffer), "htc_credit");
 }
 }
 
 
 /**
 /**

+ 22 - 9
htc/htc_credit_history.h

@@ -24,24 +24,36 @@
 #ifdef FEATURE_HTC_CREDIT_HISTORY
 #ifdef FEATURE_HTC_CREDIT_HISTORY
 
 
 /**
 /**
- * htc_credit_history_init(): Init helper function to initialize HTC credit
- *                            history buffers and variable.
+ * htc_credit_history_init() - Init helper function
+ *
+ * The htc_credit_history_init() function, helps to initialize
+ * HTC credit history buffers and variable.
+ *
  * Return: None
  * Return: None
  */
  */
-
 void htc_credit_history_init(void);
 void htc_credit_history_init(void);
+
+/**
+ * htc_credit_history_deinit() - Deinit helper function
+ *
+ * The htc_credit_history_deinit() function, helps to remove
+ * the HTC credit history buffers from minidump.
+ *
+ * Return: None
+ */
+void htc_credit_history_deinit(void);
 void htc_credit_record(enum htc_credit_exchange_type type, uint32_t tx_credit,
 void htc_credit_record(enum htc_credit_exchange_type type, uint32_t tx_credit,
 			uint32_t htc_tx_queue_depth);
 			uint32_t htc_tx_queue_depth);
 #ifdef WLAN_HANG_EVENT
 #ifdef WLAN_HANG_EVENT
 /**
 /**
- * htc_log_hang_credit_history: Log the credit history into a buffer
+ * htc_log_hang_credit_history() - Log the credit history into a buffer
  * @block: Notifier block
  * @block: Notifier block
  * @data: Private data of the block.
  * @data: Private data of the block.
  *
  *
  * HTC hang event notifier callback inovked when the recovery is triggered
  * HTC hang event notifier callback inovked when the recovery is triggered
  * to log the credit information to understand the reason for recovery.
  * to log the credit information to understand the reason for recovery.
  *
  *
- * Return: none
+ * Return: None
  */
  */
 void htc_log_hang_credit_history(struct notifier_block *block, void *data);
 void htc_log_hang_credit_history(struct notifier_block *block, void *data);
 #else
 #else
@@ -50,10 +62,6 @@ void htc_log_hang_credit_history(struct notifier_block *block, void *data)
 {
 {
 }
 }
 #endif
 #endif
-void htc_latency_detection_credit_record_time(
-	enum htc_credit_exchange_type type,
-	struct hif_opaque_softc *hif_ctx);
-
 #else /* FEATURE_HTC_CREDIT_HISTORY */
 #else /* FEATURE_HTC_CREDIT_HISTORY */
 
 
 static inline
 static inline
@@ -61,6 +69,11 @@ void htc_credit_history_init(void)
 {
 {
 }
 }
 
 
+static inline
+void htc_credit_history_deinit(void)
+{
+}
+
 static inline
 static inline
 void htc_credit_record(enum htc_credit_exchange_type type, uint32_t tx_credit,
 void htc_credit_record(enum htc_credit_exchange_type type, uint32_t tx_credit,
 			uint32_t htc_tx_queue_depth)
 			uint32_t htc_tx_queue_depth)