Ver Fonte

qcacld-3.0: Remove obsolete entries in pagefault_wakeups_ts

Currently host keeps on adding page fault timestamp in
pagefault_wakeups_ts upon receiving pf wow wakeup
and triggers SSR if below points are satisfied.
1) If num_page_fault_wakeups is equal to
   CFG_MAX_PAGEFAULT_WAKEUPS_FOR_SSR.
2) If time difference between first pf wakeup
   and current pf wakeup is lesser than
   CFG_INTERVAL_FOR_PAGEFAULT_WAKEUP_COUNT.
3) If host didn't trigger SSR due to page fault in last
   CFG_SSR_FREQUENCY_ON_PAGEFAULT time.

There is a possibility 1 and 3 criteria are met
and the first pf wakeup occurred in between 24
hours to 24 hours + CFG_INTERVAL_FOR_PAGEFAULT_WAKEUP_COUNT,
the difference between first pf wakeup and current pf wakeup
would be less than CFG_INTERVAL_FOR_PAGEFAULT_WAKEUP_COUNT,
but the actual time difference is greater than
CFG_INTERVAL_FOR_PAGEFAULT_WAKEUP_COUNT.

To address this issue add logic to ignore entries
older than CFG_INTERVAL_FOR_PAGEFAULT_WAKEUP_COUNT.

Change-Id: Ic902285c5e824583b94f8c2eeaded8b1af7971ac
CRs-Fixed: 3653166
Asutosh Mohapatra há 1 ano atrás
pai
commit
288cea3ac5
1 ficheiros alterados com 22 adições e 1 exclusões
  1. 22 1
      core/wma/src/wma_features.c

+ 22 - 1
core/wma/src/wma_features.c

@@ -3246,11 +3246,14 @@ wma_wow_wakeup_host_trigger_ssr(t_wma_handle *wma, uint32_t reason)
 	uint32_t interval_for_pagefault_wakeup_counts;
 	qdf_time_t curr_time;
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
+	int i;
+	bool ignore_pf = true;
 
 	if (!mac) {
 		wma_debug("NULL mac ptr");
 		return;
 	}
+
 	if (WOW_REASON_PAGE_FAULT != reason)
 		return;
 
@@ -3275,6 +3278,23 @@ wma_wow_wakeup_host_trigger_ssr(t_wma_handle *wma, uint32_t reason)
 
 	curr_time = qdf_get_time_of_the_day_ms();
 
+	for (i = wma->num_page_fault_wakeups - 1; i >= 0; i--) {
+		if (curr_time - wma->pagefault_wakeups_ts[i] >
+		    interval_for_pagefault_wakeup_counts) {
+			if (i == wma->num_page_fault_wakeups - 1) {
+				wma->num_page_fault_wakeups = 0;
+			} else {
+				qdf_mem_copy(&wma->pagefault_wakeups_ts[0],
+					&wma->pagefault_wakeups_ts[i+1],
+					(wma->num_page_fault_wakeups - (i+1)) *
+					sizeof(qdf_time_t));
+				wma->num_page_fault_wakeups -= (i + 1);
+			}
+			ignore_pf = false;
+			break;
+		}
+	}
+
 	if (wma->num_page_fault_wakeups == pagefault_wakeups_for_ssr) {
 		qdf_mem_copy(&wma->pagefault_wakeups_ts[0],
 			     &wma->pagefault_wakeups_ts[1],
@@ -3287,7 +3307,8 @@ wma_wow_wakeup_host_trigger_ssr(t_wma_handle *wma, uint32_t reason)
 
 	wma_nofl_debug("num pagefault wakeups %d", wma->num_page_fault_wakeups);
 
-	if (wma->num_page_fault_wakeups < pagefault_wakeups_for_ssr)
+	if (!ignore_pf ||
+	    (wma->num_page_fault_wakeups < pagefault_wakeups_for_ssr))
 		return;
 
 	if (curr_time - wma->pagefault_wakeups_ts[0] <=