From 816f75d0187d656e9506109e68c2cd789995650a Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Fri, 14 May 2021 17:35:05 +0800 Subject: [PATCH] qcacmn: Limit rx diag event count in each work process Current in wmi_rx_diag_event_work, rx diag event is processing in a while loop, if there is continuous diag event comes from fw, it is possible that it occupy the work queue, and other work are not able to run. Break the while loop so give a chance to other work. Change-Id: I7af6d60aeb8c0524cc51d663658d5b17349daa60 CRs-Fixed: 2948839 --- wmi/src/wmi_unified.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 183e01c130..f8b65d78aa 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -106,6 +106,8 @@ typedef PREPACK struct { /* Allocation of size 2048 bytes */ #define WMI_WBUFF_POOL_3_SIZE 8 +#define RX_DIAG_EVENT_WORK_PROCESS_MAX_COUNT 500 + #ifdef WMI_INTERFACE_EVENT_LOGGING #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)) /* TODO Cleanup this backported function */ @@ -2886,6 +2888,7 @@ static void wmi_rx_diag_event_work(void *arg) struct wmi_unified *wmi = arg; qdf_timer_t wd_timer; struct wmi_wq_dbg_info info; + uint32_t diag_event_process_count = 0; if (!wmi) { wmi_err("Invalid WMI handle"); @@ -2906,6 +2909,14 @@ static void wmi_rx_diag_event_work(void *arg) info.task = qdf_get_current_task(); __wmi_control_rx(wmi, buf); qdf_timer_stop(&wd_timer); + + if (diag_event_process_count++ > + RX_DIAG_EVENT_WORK_PROCESS_MAX_COUNT) { + qdf_queue_work(0, wmi->wmi_rx_diag_work_queue, + &wmi->rx_diag_event_work); + break; + } + qdf_spin_lock_bh(&wmi->diag_eventq_lock); buf = qdf_nbuf_queue_remove(&wmi->diag_event_queue); qdf_spin_unlock_bh(&wmi->diag_eventq_lock);