Browse Source

qcacmn: Use vdev list when dispatch sync complete event to MLO

In few of the scenarios, as part of sync complete handling mld_dev_context
lock is been acquired, which causes deadlock as it is already taken before
dispatching the event.

Hence get the vdev list under lock and reference taken and then dispatch
mlo_sync_complete individually.

Change-Id: Id23dba89276ecaadb02cd3a39a66b4fca3f97c7c
CRs-Fixed: 2924329
Santosh Anbu 3 năm trước cách đây
mục cha
commit
bb40ebd9a8
1 tập tin đã thay đổi với 16 bổ sung13 xóa
  1. 16 13
      umac/mlo_mgr/src/wlan_mlo_mgr_ap.c

+ 16 - 13
umac/mlo_mgr/src/wlan_mlo_mgr_ap.c

@@ -156,30 +156,33 @@ static bool mlo_pre_link_up(struct wlan_objmgr_vdev *vdev)
  */
 static void mlo_handle_link_ready(struct wlan_objmgr_vdev *vdev)
 {
-	struct wlan_mlo_dev_context *dev_ctx;
-	int i;
+	struct wlan_objmgr_vdev *vdev_list[WLAN_UMAC_MLO_MAX_VDEVS] = {NULL};
+	uint16_t num_links = 0;
+	uint8_t i;
 
 	if (!vdev || !vdev->mlo_dev_ctx) {
 		mlo_err("Invalid input");
 		return;
 	}
 
-	dev_ctx = vdev->mlo_dev_ctx;
-
 	if (!mlo_is_ap_vdev_up_allowed(vdev))
 		return;
 
-	mlo_dev_lock_acquire(dev_ctx);
-	for (i = 0; i < QDF_ARRAY_SIZE(dev_ctx->wlan_vdev_list); i++) {
-		if (dev_ctx->wlan_vdev_list[i] &&
-		    wlan_vdev_mlme_is_mlo_ap(dev_ctx->wlan_vdev_list[i]) &&
-		    mlo_pre_link_up(dev_ctx->wlan_vdev_list[i]))
+	mlo_ap_get_vdev_list(vdev, &num_links, vdev_list);
+	if (!num_links || (num_links > QDF_ARRAY_SIZE(vdev_list))) {
+		mlo_err("Invalid number of VDEVs under AP-MLD");
+		return;
+	}
+
+	for (i = 0; i < num_links; i++) {
+		if (mlo_pre_link_up(vdev_list[i]))
 			wlan_vdev_mlme_sm_deliver_evt_sync(
-				dev_ctx->wlan_vdev_list[i],
-				WLAN_VDEV_SM_EV_MLO_SYNC_COMPLETE,
-				0, NULL);
+					vdev_list[i],
+					WLAN_VDEV_SM_EV_MLO_SYNC_COMPLETE,
+					0, NULL);
+		/* Release ref taken as part of mlo_ap_get_vdev_list */
+		mlo_release_vdev_ref(vdev_list[i]);
 	}
-	mlo_dev_lock_release(dev_ctx);
 }
 
 void mlo_ap_link_sync_wait_notify(struct wlan_objmgr_vdev *vdev)