Selaa lähdekoodia

qcacmn: Error Handling in Event Based Mechanism

Error Handling in Event Based Mechanism to reduce
delay by removing sleep while getting response
from firmware.

Change-Id: I9ee8e03b0d0ebdaae150417fb0fb0531e5bf4a86
CRs-Fixed: 3268808
[B 2 vuotta sitten
vanhempi
sitoutus
1a321fabfd
3 muutettua tiedostoa jossa 21 lisäystä ja 13 poistoa
  1. 0 7
      dp/wifi3.0/dp_htt.c
  2. 14 5
      dp/wifi3.0/dp_main.c
  3. 7 1
      dp/wifi3.0/dp_types.h

+ 0 - 7
dp/wifi3.0/dp_htt.c

@@ -3919,13 +3919,6 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dp_htt_tx_stats_info("%pK: cookie <-> %d\n config_param_0 %u\n"
-			     "config_param_1 %u\n config_param_2 %u\n"
-			     "config_param_4 %u\n -------------",
-			     pdev->soc, cookie_val,
-			     config_param_0,
-			     config_param_1, config_param_2, config_param_3);
-
 	msg_word = (uint32_t *) qdf_nbuf_data(msg);
 
 	qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);

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

@@ -11144,6 +11144,7 @@ dp_txrx_stats_publish(struct cdp_soc_t *soc, uint8_t pdev_id,
 		      struct cdp_stats_extd *buf)
 {
 	struct cdp_txrx_stats_req req = {0,};
+	QDF_STATUS status;
 	struct dp_pdev *pdev =
 		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
 						   pdev_id);
@@ -11151,15 +11152,16 @@ dp_txrx_stats_publish(struct cdp_soc_t *soc, uint8_t pdev_id,
 	if (!pdev)
 		return TXRX_STATS_LEVEL_OFF;
 
-	if (pdev->pending_fw_response)
+	if (pdev->pending_fw_stats_response)
 		return TXRX_STATS_LEVEL_OFF;
 
 	dp_aggregate_pdev_stats(pdev);
 
-	pdev->pending_fw_response = true;
+	pdev->pending_fw_stats_response = true;
 	req.stats = (enum cdp_stats)HTT_DBG_EXT_STATS_PDEV_TX;
 	req.cookie_val = DBG_STATS_COOKIE_DP_STATS;
 	pdev->fw_stats_tlv_bitmap_rcvd = 0;
+	qdf_event_reset(&pdev->fw_stats_event);
 	dp_h2t_ext_stats_msg_send(pdev, req.stats, req.param0,
 				req.param1, req.param2, req.param3, 0,
 				req.cookie_val, 0);
@@ -11170,10 +11172,17 @@ dp_txrx_stats_publish(struct cdp_soc_t *soc, uint8_t pdev_id,
 				req.param1, req.param2, req.param3, 0,
 				req.cookie_val, 0);
 
-	qdf_event_reset(&pdev->fw_stats_event);
-	qdf_wait_single_event(&pdev->fw_stats_event, DP_MAX_SLEEP_TIME);
+	status =
+		qdf_wait_single_event(&pdev->fw_stats_event, DP_MAX_SLEEP_TIME);
+
+	if (status != QDF_STATUS_SUCCESS) {
+		if (status == QDF_STATUS_E_TIMEOUT)
+			qdf_debug("TIMEOUT_OCCURS");
+		pdev->pending_fw_stats_response = false;
+		return TXRX_STATS_LEVEL_OFF;
+	}
 	qdf_mem_copy(buf, &pdev->stats, sizeof(struct cdp_pdev_stats));
-	pdev->pending_fw_response = false;
+	pdev->pending_fw_stats_response = false;
 
 	return TXRX_STATS_LEVEL;
 }

+ 7 - 1
dp/wifi3.0/dp_types.h

@@ -2988,6 +2988,8 @@ struct dp_pdev {
 
 	/* qdf_event for fw_peer_stats */
 	qdf_event_t fw_peer_stats_event;
+
+	/* qdf_event for fw_stats */
 	qdf_event_t fw_stats_event;
 
 	/* User configured max number of tx buffers */
@@ -3073,8 +3075,12 @@ struct dp_pdev {
 	ol_txrx_pktdump_cb dp_tx_packetdump_cb;
 	ol_txrx_pktdump_cb dp_rx_packetdump_cb;
 #endif
+
+	/* Firmware Stats for TLV received from Firmware */
 	uint64_t fw_stats_tlv_bitmap_rcvd;
-	bool pending_fw_response;
+
+	/* For Checking Pending Firmware Response */
+	bool pending_fw_stats_response;
 };
 
 struct dp_peer;