diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 41d5a67876eb..63398c7e656b 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -5388,6 +5388,24 @@ enum hdd_link_speed_rpt_type {
#define CFG_ENABLE_SSR_MAX (1)
#define CFG_ENABLE_SSR_DEFAULT (1)
+/**
+ *
+ * gEnableDataStallDetection - Enable/Disable Data stall detection
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to enable/disable data stall detection
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_ENABLE_DATA_STALL_DETECTION "gEnableDataStallDetection"
+#define CFG_ENABLE_DATA_STALL_DETECTION_MIN (0)
+#define CFG_ENABLE_DATA_STALL_DETECTION_MAX (1)
+#define CFG_ENABLE_DATA_STALL_DETECTION_DEFAULT (1)
+
/*
*
* gEnableOverLapCh - Enables Overlap Channel. If set, allow overlapping
@@ -13858,6 +13876,7 @@ struct hdd_config {
uint8_t retryLimitOne;
uint8_t retryLimitTwo;
bool enableSSR;
+ bool enable_data_stall_det;
uint32_t cfgMaxMediumTime;
bool enableVhtFor24GHzBand;
bool enable_sap_vendor_vht;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index b9c7cd449d6c..d82d5c064b47 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -2627,6 +2627,13 @@ struct reg_table_entry g_registry_table[] = {
CFG_ENABLE_SSR_MAX,
cb_notify_set_enable_ssr, 0),
+ REG_VARIABLE(CFG_ENABLE_DATA_STALL_DETECTION, WLAN_PARAM_Integer,
+ struct hdd_config, enable_data_stall_det,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_ENABLE_DATA_STALL_DETECTION_DEFAULT,
+ CFG_ENABLE_DATA_STALL_DETECTION_MIN,
+ CFG_ENABLE_DATA_STALL_DETECTION_MAX),
+
REG_VARIABLE(CFG_MAX_MEDIUM_TIME, WLAN_PARAM_Integer,
struct hdd_config, cfgMaxMediumTime,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -6466,6 +6473,8 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
hdd_ctx->config->enableLpwrImgTransition);
hdd_debug("Name = [gEnableSSR] Value = [%u] ",
hdd_ctx->config->enableSSR);
+ hdd_debug("Name = [gEnableDataStallDetection] Value = [%u] ",
+ hdd_ctx->config->enable_data_stall_det);
hdd_debug("Name = [gEnableVhtFor24GHzBand] Value = [%u] ",
hdd_ctx->config->enableVhtFor24GHzBand);
hdd_debug("Name = [gEnableIbssHeartBeatOffload] Value = [%u] ",
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 7f103ed4a621..0ab451a6c0ad 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11717,7 +11717,9 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
INIT_COMPLETION(context->response_event);
spin_unlock(&hdd_context_lock);
- cdp_post_data_stall_event(soc, DATA_STALL_LOG_INDICATOR_FRAMEWORK,
+ if (hdd_ctx->config->enable_data_stall_det)
+ cdp_post_data_stall_event(soc,
+ DATA_STALL_LOG_INDICATOR_FRAMEWORK,
DATA_STALL_LOG_NUD_FAILURE,
0xFF, 0XFF,
DATA_STALL_LOG_RECOVERY_TRIGGER_PDR);
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 5ddd927ffb5b..910aac8bd6ee 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -9181,6 +9181,10 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad
else
hdd_set_idle_ps_config(hdd_ctx, false);
+ /* Send Enable/Disable data stall detection cmd to FW */
+ sme_cli_set_command(0, WMI_PDEV_PARAM_DATA_STALL_DETECT_ENABLE,
+ hdd_ctx->config->enable_data_stall_det, PDEV_CMD);
+
if (hdd_ctx->config->enable_go_cts2self_for_sta)
sme_set_cts2self_for_p2p_go(hdd_ctx->hHal);
diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c
index 9f09de0f8057..4b5a8bfdf795 100644
--- a/core/hdd/src/wlan_hdd_softap_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c
@@ -564,7 +564,8 @@ static void __hdd_softap_tx_timeout(struct net_device *dev)
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
"Detected data stall due to continuous TX timeouts");
adapter->hdd_stats.tx_rx_stats.cont_txtimeout_cnt = 0;
- cdp_post_data_stall_event(soc,
+ if (hdd_ctx->config->enable_data_stall_det)
+ cdp_post_data_stall_event(soc,
DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
0xFF, 0xFF,
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index db705c89c20b..d4ccb9983cc1 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -929,7 +929,8 @@ static void __hdd_tx_timeout(struct net_device *dev)
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
"Data stall due to continuous TX timeouts");
adapter->hdd_stats.tx_rx_stats.cont_txtimeout_cnt = 0;
- cdp_post_data_stall_event(soc,
+ if (hdd_ctx->config->enable_data_stall_det)
+ cdp_post_data_stall_event(soc,
DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
DATA_STALL_LOG_HOST_STA_TX_TIMEOUT,
0xFF, 0xFF,