Sfoglia il codice sorgente

qcacmn: Avoid multiple pre reset done triggers in Umac reset

Make sure that the pre reset done notification is sent
only once during Umac reset.

Change-Id: I1d9e1d8caef49443d25e879086043e815ea087a1
CRs-Fixed: 3594653
Pavankumar Nandeshwar 1 anno fa
parent
commit
d003031f93

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

@@ -2766,6 +2766,15 @@ void dp_reo_desc_freelist_destroy(struct dp_soc *soc);
 void dp_reset_rx_reo_tid_queue(struct dp_soc *soc, void *hw_qdesc_vaddr,
 			       uint32_t size);
 
+
+static inline void dp_umac_reset_trigger_pre_reset_notify_cb(struct dp_soc *soc)
+{
+	notify_pre_reset_fw_callback callback = soc->notify_fw_callback;
+
+	if (callback)
+		callback(soc);
+}
+
 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
 /**
  * dp_umac_reset_complete_umac_recovery() - Complete Umac reset session
@@ -2850,7 +2859,10 @@ QDF_STATUS dp_mlo_umac_reset_stats_print(struct dp_soc *soc)
 	return QDF_STATUS_SUCCESS;
 }
 #endif
-
+#else
+static inline void dp_umac_reset_trigger_pre_reset_notify_cb(struct dp_soc *soc)
+{
+}
 #endif
 
 #if defined(DP_UMAC_HW_RESET_SUPPORT) && defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)

+ 12 - 5
dp/wifi3.0/dp_main.c

@@ -11618,12 +11618,17 @@ void dp_check_n_notify_umac_prereset_done(struct dp_soc *soc)
 	if (soc->service_rings_running)
 		return;
 
+	/* Unregister the callback */
+	dp_unregister_notify_umac_pre_reset_fw_callback(soc);
+
+	/* Check if notify was already sent by any other thread */
+	if (qdf_atomic_test_and_set_bit(DP_UMAC_RESET_NOTIFY_DONE,
+					&soc->service_rings_running))
+		return;
+
 	/* Notify the firmware that Umac pre reset is complete */
 	dp_umac_reset_notify_action_completion(soc,
 					       UMAC_RESET_ACTION_DO_PRE_RESET);
-
-	/* Unregister the callback */
-	dp_unregister_notify_umac_pre_reset_fw_callback(soc);
 }
 
 /**
@@ -11773,7 +11778,7 @@ static QDF_STATUS dp_umac_reset_service_handle_n_notify_done(struct dp_soc *soc)
 
 non_ppeds:
 	dp_register_notify_umac_pre_reset_fw_callback(soc);
-	dp_check_n_notify_umac_prereset_done(soc);
+	dp_umac_reset_trigger_pre_reset_notify_cb(soc);
 	soc->umac_reset_ctx.nbuf_list = NULL;
 	return QDF_STATUS_SUCCESS;
 }
@@ -11811,7 +11816,7 @@ static inline void dp_umac_reset_ppeds_start(struct dp_soc *soc)
 static QDF_STATUS dp_umac_reset_service_handle_n_notify_done(struct dp_soc *soc)
 {
 	dp_register_notify_umac_pre_reset_fw_callback(soc);
-	dp_check_n_notify_umac_prereset_done(soc);
+	dp_umac_reset_trigger_pre_reset_notify_cb(soc);
 	soc->umac_reset_ctx.nbuf_list = NULL;
 	return QDF_STATUS_SUCCESS;
 }
@@ -11886,6 +11891,8 @@ static QDF_STATUS dp_umac_reset_handle_post_reset_complete(struct dp_soc *soc)
 
 	soc->umac_reset_ctx.nbuf_list = NULL;
 
+	soc->service_rings_running = 0;
+
 	dp_resume_reo_send_cmd(soc);
 
 	dp_umac_reset_ppeds_start(soc);

+ 1 - 2
dp/wifi3.0/dp_rings_main.c

@@ -706,8 +706,7 @@ uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget, int cpu)
 budget_done:
 	qdf_atomic_clear_bit(cpu, &soc->service_rings_running);
 
-	if (soc->notify_fw_callback)
-		soc->notify_fw_callback(soc);
+	dp_umac_reset_trigger_pre_reset_notify_cb(soc);
 
 	return dp_budget - budget;
 }

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

@@ -20,6 +20,7 @@
 #include <qdf_types.h>
 struct dp_soc;
 
+#define	DP_UMAC_RESET_NOTIFY_DONE	20
 /**
  * enum umac_reset_action - Actions supported by the UMAC reset
  * @UMAC_RESET_ACTION_NONE: No action