瀏覽代碼

qcacmn: Set NOL left time as 0 in print nol if it is negative

In some platform the timer is not precise. NOL timer may take more
than expected. During this time When print nol is called, NOL left
time is negative.

Set NOL left time as 0 in print nol if it is negative.

Change-Id: Ic6aec5f7ee080625adb39ae75785a271ad782f6c
CRs-Fixed: 2926548
bings 4 年之前
父節點
當前提交
8144d64a26
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      umac/dfs/core/src/misc/dfs_nol.c

+ 4 - 1
umac/dfs/core/src/misc/dfs_nol.c

@@ -400,7 +400,10 @@ void dfs_print_nol(struct wlan_dfs *dfs)
 	while (nol) {
 		diff_ms = qdf_do_div(qdf_get_monotonic_boottime() -
 				     nol->nol_start_us, 1000);
-		diff_ms = (nol->nol_timeout_ms - diff_ms);
+		if (nol->nol_timeout_ms > diff_ms)
+			diff_ms = (nol->nol_timeout_ms - diff_ms);
+		else
+			diff_ms = 0;
 		remaining_sec = diff_ms / 1000; /* Convert to seconds */
 		dfs_info(NULL, WLAN_DEBUG_DFS_ALWAYS,
 			"nol:%d channel=%d MHz width=%d MHz time left=%u seconds nol start_us=%llu",