Переглянути джерело

qcacld-3.0: rate limit logs from HDD during scan and connect

Currently logs are printed from HDD during scan and connect for every
retry, which is causing MCThread to get stuck at printk and crash

Rate limit the hdd logs to print for every 5 retries to avoid filling
the log buffer. Also change some error logs to debug level.

Change-Id: I09ad38cd89bbd20081673142bf5a350c55b0f005
CRs-Fixed: 2090761
Vignesh Viswanathan 7 роки тому
батько
коміт
82bd2539c9
2 змінених файлів з 16 додано та 10 видалено
  1. 5 5
      core/hdd/src/wlan_hdd_main.c
  2. 11 5
      core/hdd/src/wlan_hdd_scan.c

+ 5 - 5
core/hdd/src/wlan_hdd_main.c

@@ -12225,7 +12225,7 @@ bool hdd_is_connection_in_progress(uint8_t *session_id,
 			&& (eConnectionState_Connecting ==
 				(WLAN_HDD_GET_STATION_CTX_PTR(adapter))->
 					conn_info.connState)) {
-			hdd_err("%pK(%d) Connection is in progress",
+			hdd_debug("%pK(%d) Connection is in progress",
 				WLAN_HDD_GET_STATION_CTX_PTR(adapter),
 				adapter->sessionId);
 			if (session_id && reason) {
@@ -12243,7 +12243,7 @@ bool hdd_is_connection_in_progress(uint8_t *session_id,
 			     WLAN_HDD_GET_HAL_CTX(adapter),
 			     adapter->sessionId)) ||
 		    hdd_is_roaming_in_progress(adapter)) {
-			hdd_err("%pK(%d) Reassociation in progress",
+			hdd_debug("%pK(%d) Reassociation in progress",
 				WLAN_HDD_GET_STATION_CTX_PTR(adapter),
 				adapter->sessionId);
 			if (session_id && reason) {
@@ -12263,7 +12263,7 @@ bool hdd_is_connection_in_progress(uint8_t *session_id,
 				hdd_sta_ctx->conn_info.uIsAuthenticated)) {
 				sta_mac = (uint8_t *)
 					&(adapter->macAddressCurrent.bytes[0]);
-				hdd_err("client " MAC_ADDRESS_STR
+				hdd_debug("client " MAC_ADDRESS_STR
 					" is in middle of WPS/EAPOL exchange.",
 					MAC_ADDR_ARRAY(sta_mac));
 				if (session_id && reason) {
@@ -12284,7 +12284,7 @@ bool hdd_is_connection_in_progress(uint8_t *session_id,
 				sta_mac = (uint8_t *)
 						&(adapter->aStaInfo[sta_id].
 							macAddrSTA.bytes[0]);
-				hdd_err("client " MAC_ADDRESS_STR
+				hdd_debug("client " MAC_ADDRESS_STR
 				" of SAP/GO is in middle of WPS/EAPOL exchange",
 				MAC_ADDR_ARRAY(sta_mac));
 				if (session_id && reason) {
@@ -12294,7 +12294,7 @@ bool hdd_is_connection_in_progress(uint8_t *session_id,
 				return true;
 			}
 			if (hdd_ctx->connection_in_progress) {
-				hdd_err("AP/GO: connection is in progress");
+				hdd_debug("AP/GO: connection is in progress");
 				return true;
 			}
 		}

+ 11 - 5
core/hdd/src/wlan_hdd_scan.c

@@ -62,6 +62,11 @@
 #define SCAN_DONE_EVENT_BUF_SIZE 4096
 #define RATE_MASK 0x7f
 
+/*
+ * Count to ratelimit the HDD logs during Scan and connect
+ */
+#define HDD_SCAN_REJECT_RATE_LIMIT 5
+
 /**
  * enum essid_bcast_type - SSID broadcast type
  * @eBCAST_UNKNOWN: Broadcast unknown
@@ -550,7 +555,9 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 	/* Check if scan is allowed at this point of time */
 	if (hdd_is_connection_in_progress(&curr_session_id, &curr_reason)) {
 		scan_ebusy_cnt++;
-		hdd_err("Scan not allowed. scan_ebusy_cnt: %d", scan_ebusy_cnt);
+		hdd_err_ratelimited(HDD_SCAN_REJECT_RATE_LIMIT,
+			"Scan not allowed. scan_ebusy_cnt: %d Session %d Reason %d",
+			scan_ebusy_cnt, curr_session_id, curr_reason);
 		if (hdd_ctx->last_scan_reject_session_id != curr_session_id ||
 		    hdd_ctx->last_scan_reject_reason != curr_reason ||
 		    !hdd_ctx->last_scan_reject_timestamp) {
@@ -562,14 +569,13 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 			hdd_ctx->scan_reject_cnt = 0;
 		} else {
 			hdd_ctx->scan_reject_cnt++;
-			hdd_debug("curr_session id %d curr_reason %d count %d threshold time has elapsed? %d",
-				curr_session_id, curr_reason, hdd_ctx->scan_reject_cnt,
-				qdf_system_time_after(jiffies_to_msecs(jiffies),
-				hdd_ctx->last_scan_reject_timestamp));
 			if ((hdd_ctx->scan_reject_cnt >=
 			   SCAN_REJECT_THRESHOLD) &&
 			   qdf_system_time_after(jiffies_to_msecs(jiffies),
 			   hdd_ctx->last_scan_reject_timestamp)) {
+				hdd_err("scan reject threshold reached Session %d Reason %d count %d",
+					curr_session_id, curr_reason,
+					hdd_ctx->scan_reject_cnt);
 				hdd_ctx->last_scan_reject_timestamp = 0;
 				hdd_ctx->scan_reject_cnt = 0;
 				if (hdd_ctx->config->enable_fatal_event) {