Просмотр исходного кода

qcacmn: Prevent parallel start/stop of target/soc

Prevent start and stop process of target or soc, as it could
lead to issues for mlo enabled socs of that mlo group

Change-Id: Ib2b28443828cbc4be670f5bc8a69d4fecfc1c8b7
CRs-Fixed: 3500007
Surya Prakash Raajen 2 лет назад
Родитель
Сommit
43057d2442

+ 4 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -130,6 +130,8 @@ struct mlo_chip_info {
 	uint8_t adj_chip_ids[MAX_MLO_CHIPS][MAX_ADJ_CHIPS];
 };
 
+#define START_STOP_INPROGRESS_BIT 0
+
 /**
  * struct mlo_setup_info: MLO setup status per link
  * @ml_grp_id: Unique id for ML grouping of Pdevs/links
@@ -146,6 +148,7 @@ struct mlo_chip_info {
  * @trigger_umac_reset: teardown require umac reset, for mode1 SSR
  * @state_lock: lock to protect access to link state
  * @event: event for teardown completion
+ * @start_stop_inprogress: MLO group start/stop in progress
  * @dp_handle: pointer to DP ML context
  * @chip_info: chip specific info of the soc
  * @tsf_sync_enabled: MLO TSF sync is enabled at FW or not
@@ -165,6 +168,7 @@ struct mlo_setup_info {
 	bool trigger_umac_reset;
 	qdf_spinlock_t state_lock;
 	qdf_event_t event;
+	unsigned long start_stop_inprogress;
 	struct cdp_mlo_ctxt *dp_handle;
 	struct mlo_chip_info chip_info;
 	bool tsf_sync_enabled;

+ 18 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h

@@ -45,6 +45,24 @@ void mlo_setup_deinit(void);
  */
 bool mlo_is_ml_soc(struct wlan_objmgr_psoc *psoc, uint8_t grp_id);
 
+/**
+ * mlo_check_start_stop_inprogress() - API to set  ML group
+ * start or stop in progress bit and return last value
+ * @grp_id: ID of the required mlo group to be checked
+ *
+ * Return: true if mlo group is in start/stop, or else return false
+ */
+bool mlo_check_start_stop_inprogress(uint8_t grp_id);
+
+/**
+ * mlo_clear_start_stop_inprogress() - API to clear the value of ML group
+ *                                   start or stop in progress bit
+ * @grp_id: ID of the required mlo group to be set
+ *
+ * Return: none
+ */
+void mlo_clear_start_stop_inprogress(uint8_t grp_id);
+
 /**
  * mlo_get_soc_list() - API to get the list of SOCs participating in MLO
  * @soc_list: list where ML participating SOCs need to be populated

+ 40 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_setup.c

@@ -334,6 +334,46 @@ static QDF_STATUS mlo_find_pdev_idx(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_E_FAILURE;
 }
 
+bool mlo_check_start_stop_inprogress(uint8_t grp_id)
+{
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+
+	if (!mlo_ctx)
+		return true;
+
+	if (grp_id >= mlo_ctx->total_grp) {
+		mlo_err("Invalid grp id %d, total no of groups %d",
+			grp_id, mlo_ctx->total_grp);
+		return true;
+	}
+
+	return qdf_atomic_test_and_set_bit(
+			START_STOP_INPROGRESS_BIT,
+			&mlo_ctx->setup_info[grp_id].start_stop_inprogress);
+}
+
+qdf_export_symbol(mlo_check_start_stop_inprogress);
+
+void mlo_clear_start_stop_inprogress(uint8_t grp_id)
+{
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+
+	if (!mlo_ctx)
+		return;
+
+	if (grp_id >= mlo_ctx->total_grp) {
+		mlo_err("Invalid grp id %d, total no of groups %d",
+			grp_id, mlo_ctx->total_grp);
+		return;
+	}
+
+	qdf_atomic_clear_bit(
+			START_STOP_INPROGRESS_BIT,
+			&mlo_ctx->setup_info[grp_id].start_stop_inprogress);
+}
+
+qdf_export_symbol(mlo_clear_start_stop_inprogress);
+
 #define WLAN_SOC_ID_NOT_INITIALIZED -1
 bool mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev **wlan_vdev_list,
 				uint8_t vdev_count)