diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-10-26 10:37:37 +0530 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-11-23 12:01:49 +0800 |
commit | 522fff122d95213dd553374519ba2cc3f369e779 (patch) | |
tree | 75b6a3f00cdcd2a087b26a0a4c1d65a8d13c52ad | |
parent | b57fdb398c6cbdbcb24031ee3416a7573e7c58c8 (diff) | |
download | wlan-522fff122d95213dd553374519ba2cc3f369e779.tar.gz |
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.
Bug: 306769308
Test: Regression Test
Change-Id: Ic902285c5e824583b94f8c2eeaded8b1af7971ac
CRs-Fixed: 3653166
Signed-off-by: Hsiu-Chang Chen <hsiuchangchen@google.com>
-rw-r--r-- | qcacld-3.0/core/wma/src/wma_features.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/qcacld-3.0/core/wma/src/wma_features.c b/qcacld-3.0/core/wma/src/wma_features.c index 0f097dc..587f3bf 100644 --- a/qcacld-3.0/core/wma/src/wma_features.c +++ b/qcacld-3.0/core/wma/src/wma_features.c @@ -2893,11 +2893,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; @@ -2922,6 +2925,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], @@ -2934,7 +2954,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] <= |