소스 검색

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 년 전
부모
커밋
6451c23fef
1개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  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,