Browse Source

qcacmn: Fix uninitialized mon status desc pool lock issue

Currently Mon status ring resources allocation and cleanup
is not in sync, during cleanup we are freeing more than allocated
for single MAC solutions like QCA6750.

Fix this by cleaning mon status ring resources properly for single
mac QCA6750.

Change-Id: I8c8564d106fda29f7a6a36f887aa3adee9dc1edf
CRs-Fixed: 3693448
Karthik Kantamneni 1 year ago
parent
commit
743218686f
1 changed files with 17 additions and 15 deletions
  1. 17 15
      dp/wifi3.0/monitor/1.0/dp_rx_mon_dest_1.0.c

+ 17 - 15
dp/wifi3.0/monitor/1.0/dp_rx_mon_dest_1.0.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -1501,25 +1501,27 @@ dp_rx_pdev_mon_desc_pool_init(struct dp_pdev *pdev)
 	qdf_spinlock_create(&pdev->monitor_pdev->mon_lock);
 }
 
-static void
-dp_rx_pdev_mon_cmn_buffers_free(struct dp_pdev *pdev, int mac_id)
-{
-	uint8_t pdev_id = pdev->pdev_id;
-	int mac_for_pdev;
-
-	mac_for_pdev = dp_get_lmac_id_for_pdev_id(pdev->soc, mac_id, pdev_id);
-	dp_rx_pdev_mon_status_buffers_free(pdev, mac_for_pdev);
-
-	dp_rx_pdev_mon_dest_buffers_free(pdev, mac_for_pdev);
-}
-
 void
 dp_rx_pdev_mon_buffers_free(struct dp_pdev *pdev)
 {
 	int mac_id;
+	int mac_for_pdev;
+	uint8_t pdev_id = pdev->pdev_id;
+	struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx = pdev->soc->wlan_cfg_ctx;
 
-	for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++)
-		dp_rx_pdev_mon_cmn_buffers_free(pdev, mac_id);
+	for (mac_id = 0; mac_id < soc_cfg_ctx->num_rxdma_status_rings_per_pdev;
+	     mac_id++) {
+		mac_for_pdev = dp_get_lmac_id_for_pdev_id(pdev->soc, mac_id,
+							  pdev_id);
+		dp_rx_pdev_mon_status_buffers_free(pdev, mac_for_pdev);
+	}
+
+	for (mac_id = 0; mac_id < soc_cfg_ctx->num_rxdma_dst_rings_per_pdev;
+	     mac_id++) {
+		mac_for_pdev = dp_get_lmac_id_for_pdev_id(pdev->soc, mac_id,
+							  pdev_id);
+		dp_rx_pdev_mon_dest_buffers_free(pdev, mac_for_pdev);
+	}
 	pdev->monitor_pdev->pdev_mon_init = 0;
 }