Bläddra i källkod

qcacld-3.0: Use time_after api to take care of jiffies wrap around

jiffies wrap around can cause the confusion that the threshold
time has has elapsed and thus raise false alarm for scan reject.

To fix this use time_after api to take care of jiffies wrap around.

Change-Id: I20c0abbcaab0bea8054c2f497f41e50572008a8c
CRs-Fixed: 2075451
Abhishek Singh 7 år sedan
förälder
incheckning
6451c23fef
1 ändrade filer med 7 tillägg och 7 borttagningar
  1. 7 7
      core/hdd/src/wlan_hdd_scan.c

+ 7 - 7
core/hdd/src/wlan_hdd_scan.c

@@ -923,15 +923,15 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 			pHddCtx->last_scan_reject_session_id = curr_session_id;
 			pHddCtx->last_scan_reject_reason = curr_reason;
 			pHddCtx->last_scan_reject_timestamp =
-				jiffies_to_msecs(jiffies);
+				jiffies_to_msecs(jiffies) +
+				SCAN_REJECT_THRESHOLD_TIME;
 		} else {
-			hdd_debug("curr_session id %d curr_reason %d time delta %lu",
+			hdd_debug("curr_session id %d curr_reason %d threshold time has elapsed? %d",
 				curr_session_id, curr_reason,
-				(jiffies_to_msecs(jiffies) -
-				 pHddCtx->last_scan_reject_timestamp));
-			if ((jiffies_to_msecs(jiffies) -
-			    pHddCtx->last_scan_reject_timestamp) >=
-			    SCAN_REJECT_THRESHOLD_TIME) {
+				qdf_system_time_after(jiffies_to_msecs(jiffies),
+				pHddCtx->last_scan_reject_timestamp));
+			if (qdf_system_time_after(jiffies_to_msecs(jiffies),
+			   pHddCtx->last_scan_reject_timestamp)) {
 				pHddCtx->last_scan_reject_timestamp = 0;
 				if (pHddCtx->config->enable_fatal_event) {
 					cds_flush_logs(WLAN_LOG_TYPE_FATAL,