Эх сурвалжийг харах

qcacmn: Check RX rings empty after received WoW ACK

After received WoW ACK from FW, there should be some RX packets
coming and IRQ delayed, if these packets are not got processed,
FW UMAC will crash. Change adds an explicit check and abort suspend
if rings are not empty.

Change-Id: I758e1b71d0f5fc9be8cab1bea0f3db20c1698ecc
CRs-Fixed: 3693657
Yu Tian 1 жил өмнө
parent
commit
be177477de

+ 6 - 4
dp/inc/cdp_txrx_misc.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2016-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
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -925,18 +925,20 @@ cdp_soc_is_swlm_enabled(ol_txrx_soc_handle soc)
  * cdp_display_txrx_hw_info() - Dump the DP rings info
  * cdp_display_txrx_hw_info() - Dump the DP rings info
  * @soc: soc handle
  * @soc: soc handle
  *
  *
- * Return: none
+ * Return: rings are empty
  */
  */
-static inline void
+static inline bool
 cdp_display_txrx_hw_info(ol_txrx_soc_handle soc)
 cdp_display_txrx_hw_info(ol_txrx_soc_handle soc)
 {
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		dp_cdp_debug("Invalid Instance:");
 		dp_cdp_debug("Invalid Instance:");
-		return;
+		return true;
 	}
 	}
 
 
 	if (soc->ops->misc_ops->display_txrx_hw_info)
 	if (soc->ops->misc_ops->display_txrx_hw_info)
 		return soc->ops->misc_ops->display_txrx_hw_info(soc);
 		return soc->ops->misc_ops->display_txrx_hw_info(soc);
+
+	return true;
 }
 }
 
 
 /**
 /**

+ 2 - 2
dp/inc/cdp_txrx_ops.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  * 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
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -1920,7 +1920,7 @@ struct cdp_misc_ops {
 	QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl,
 	QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl,
 				      uint8_t val);
 				      uint8_t val);
 	uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl);
 	uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl);
-	void (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl);
+	bool (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl);
 	uint32_t (*get_tx_rings_grp_bitmap)(struct cdp_soc_t *soc_hdl);
 	uint32_t (*get_tx_rings_grp_bitmap)(struct cdp_soc_t *soc_hdl);
 #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF
 #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF
 	int (*set_peer_txq_flush_config)(struct cdp_soc_t *soc_hdl,
 	int (*set_peer_txq_flush_config)(struct cdp_soc_t *soc_hdl,

+ 6 - 5
dp/wifi3.0/dp_rings.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2016-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
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -565,9 +565,9 @@ dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev);
  * READ NOC error when UMAC is in low power state. MCC does not have
  * READ NOC error when UMAC is in low power state. MCC does not have
  * device force wake working yet.
  * device force wake working yet.
  *
  *
- * Return: none
+ * Return: rings are empty
  */
  */
-void dp_display_srng_info(struct cdp_soc_t *soc_hdl);
+bool dp_display_srng_info(struct cdp_soc_t *soc_hdl);
 
 
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
 void dp_drain_txrx(struct cdp_soc_t *soc_handle, uint8_t rx_only);
 void dp_drain_txrx(struct cdp_soc_t *soc_handle, uint8_t rx_only);
@@ -809,11 +809,12 @@ static inline QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc)
  *
  *
  * This function dumps the SW Read/Write idx for the important rings.
  * This function dumps the SW Read/Write idx for the important rings.
  *
  *
- * Return: none
+ * Return:  rings are empty
  */
  */
-static inline void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
+static inline bool dp_display_srng_info(struct cdp_soc_t *soc_hdl)
 {
 {
 /*TODO add support display SOFTUMAC data rings info*/
 /*TODO add support display SOFTUMAC data rings info*/
+	return true;
 }
 }
 
 
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)

+ 9 - 3
dp/wifi3.0/dp_rings_main.c

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2016-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
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -2864,13 +2864,14 @@ void dp_update_soft_irq_limits(struct dp_soc *soc, uint32_t tx_limit,
  * READ NOC error when UMAC is in low power state. MCC does not have
  * READ NOC error when UMAC is in low power state. MCC does not have
  * device force wake working yet.
  * device force wake working yet.
  *
  *
- * Return: none
+ * Return: rings are empty
  */
  */
-void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
+bool dp_display_srng_info(struct cdp_soc_t *soc_hdl)
 {
 {
 	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
 	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
 	hal_soc_handle_t hal_soc = soc->hal_soc;
 	hal_soc_handle_t hal_soc = soc->hal_soc;
 	uint32_t hp, tp, i;
 	uint32_t hp, tp, i;
+	bool ret = true;
 
 
 	dp_info("SRNG HP-TP data:");
 	dp_info("SRNG HP-TP data:");
 	for (i = 0; i < soc->num_tcl_data_rings; i++) {
 	for (i = 0; i < soc->num_tcl_data_rings; i++) {
@@ -2890,6 +2891,9 @@ void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
 	for (i = 0; i < soc->num_reo_dest_rings; i++) {
 	for (i = 0; i < soc->num_reo_dest_rings; i++) {
 		hal_get_sw_hptp(hal_soc, soc->reo_dest_ring[i].hal_srng,
 		hal_get_sw_hptp(hal_soc, soc->reo_dest_ring[i].hal_srng,
 				&tp, &hp);
 				&tp, &hp);
+		if (hp != tp)
+			ret = false;
+
 		dp_info("REO DST ring[%d]: hp=0x%x, tp=0x%x", i, hp, tp);
 		dp_info("REO DST ring[%d]: hp=0x%x, tp=0x%x", i, hp, tp);
 	}
 	}
 
 
@@ -2901,6 +2905,8 @@ void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
 
 
 	hal_get_sw_hptp(hal_soc, soc->wbm_desc_rel_ring.hal_srng, &tp, &hp);
 	hal_get_sw_hptp(hal_soc, soc->wbm_desc_rel_ring.hal_srng, &tp, &hp);
 	dp_info("WBM desc release ring: hp=0x%x, tp=0x%x", hp, tp);
 	dp_info("WBM desc release ring: hp=0x%x, tp=0x%x", hp, tp);
+
+	return ret;
 }
 }
 
 
 /**
 /**