Sfoglia il codice sorgente

qcacmn: Flush the REO cmd list during detach

When suspend is done, and if there are any outstanding
REO commands to HW, there could be a leak from allocated
buffers. FLush the buffer list during detach.

Change-Id: I62a7b612c401a36f5098163e017c3b42d7d3750d
Manoj Ekbote 7 anni fa
parent
commit
2a372d279b
3 ha cambiato i file con 31 aggiunte e 2 eliminazioni
  1. 1 0
      dp/wifi3.0/dp_internal.h
  2. 3 2
      dp/wifi3.0/dp_main.c
  3. 27 0
      dp/wifi3.0/dp_reo.c

+ 1 - 0
dp/wifi3.0/dp_internal.h

@@ -276,6 +276,7 @@ extern QDF_STATUS dp_reo_send_cmd(struct dp_soc *soc,
 	enum hal_reo_cmd_type type, struct hal_reo_cmd_params *params,
 	void (*callback_fn), void *data);
 
+extern void dp_reo_cmdlist_destroy(struct dp_soc *soc);
 extern void dp_reo_status_ring_handler(struct dp_soc *soc);
 void dp_aggregate_vdev_stats(struct dp_vdev *vdev);
 uint16_t dp_tx_me_send_convert_ucast(struct cdp_vdev *vdev_handle,

+ 3 - 2
dp/wifi3.0/dp_main.c

@@ -1675,12 +1675,13 @@ static void dp_soc_detach_wifi3(void *txrx_soc)
 	dp_srng_cleanup(soc, &soc->reo_cmd_ring, REO_CMD, 0);
 	dp_srng_cleanup(soc, &soc->reo_status_ring, REO_STATUS, 0);
 
-	qdf_spinlock_destroy(&soc->rx.reo_cmd_lock);
-
 	qdf_spinlock_destroy(&soc->peer_ref_mutex);
 	htt_soc_detach(soc->htt_handle);
 
+	dp_reo_cmdlist_destroy(soc);
+	qdf_spinlock_destroy(&soc->rx.reo_cmd_lock);
 	dp_reo_desc_freelist_destroy(soc);
+
 	wlan_cfg_soc_detach(soc->wlan_cfg_ctx);
 
 	dp_soc_wds_detach(soc);

+ 27 - 0
dp/wifi3.0/dp_reo.c

@@ -168,3 +168,30 @@ next:
 
 	hal_srng_access_end(soc->hal_soc, soc->reo_status_ring.hal_srng);
 }
+
+/**
+ * dp_reo_cmdlist_destroy - Free REO commands in the queue
+ * @soc: DP SoC hanle
+ *
+ */
+void dp_reo_cmdlist_destroy(struct dp_soc *soc)
+{
+	struct dp_reo_cmd_info *reo_cmd = NULL;
+	union hal_reo_status reo_status;
+
+	reo_status.queue_status.header.status =
+			HAL_REO_CMD_FAILED;
+
+	qdf_spin_lock_bh(&soc->rx.reo_cmd_lock);
+	TAILQ_FOREACH(reo_cmd, &soc->rx.reo_cmd_list,
+		      reo_cmd_list_elem) {
+		TAILQ_REMOVE(&soc->rx.reo_cmd_list, reo_cmd,
+		       reo_cmd_list_elem);
+		if (reo_cmd) {
+			reo_cmd->handler(soc, reo_cmd->data,
+					&reo_status);
+			qdf_mem_free(reo_cmd);
+		}
+	}
+	qdf_spin_unlock_bh(&soc->rx.reo_cmd_lock);
+}