浏览代码

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,