소스 검색

qcacmn: Free tx desc pool at dp flow control deinit

Currently if tx flow control is enabled allocated tx desc pools
are deleted only in tx flow pool unmap handler from control path.
So cases in which control path unable to handle pool unmap handler
leads to tx desc pool resources memory leak. To handle this free
allocated all tx desc pool resources as part of dp flow control
deinit which is done as part of soc tx detach.

Change-Id: Ib750c2ce39baf7fc5aae5f0c8cb62bc848d2f864
CRs-Fixed: 2511515
Sravan Kumar Kairam 5 년 전
부모
커밋
220755895d
1개의 변경된 파일23개의 추가작업 그리고 0개의 파일을 삭제
  1. 23 0
      dp/wifi3.0/dp_tx_flow_control.c

+ 23 - 0
dp/wifi3.0/dp_tx_flow_control.c

@@ -515,6 +515,27 @@ void dp_tx_flow_control_init(struct dp_soc *soc)
 	qdf_spinlock_create(&soc->flow_pool_array_lock);
 }
 
+/**
+ * dp_tx_desc_pool_dealloc() - De-allocate tx desc pool
+ * @tx_desc_pool: Handle to flow_pool
+ *
+ * Return: none
+ */
+static inline void dp_tx_desc_pool_dealloc(struct dp_soc *soc)
+{
+	struct dp_tx_desc_pool_s *tx_desc_pool;
+	int i;
+
+	for (i = 0; i < MAX_TXDESC_POOLS; i++) {
+		tx_desc_pool = &((soc)->tx_desc[i]);
+		if (!tx_desc_pool->desc_pages.num_pages)
+			continue;
+
+		if (dp_tx_desc_pool_free(soc, i) != QDF_STATUS_SUCCESS)
+			dp_err("Tx Desc Pool:%d Free failed", i);
+	}
+}
+
 /**
  * dp_tx_flow_control_deinit() - Deregister fw based tx flow control
  * @tx_desc_pool: Handle to flow_pool
@@ -523,6 +544,8 @@ void dp_tx_flow_control_init(struct dp_soc *soc)
  */
 void dp_tx_flow_control_deinit(struct dp_soc *soc)
 {
+	dp_tx_desc_pool_dealloc(soc);
+
 	qdf_spinlock_destroy(&soc->flow_pool_array_lock);
 }