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
This commit is contained in:
Jingxiang Ge
2021-05-14 17:35:05 +08:00
committed by Madan Koyyalamudi
parent ecd3f845e7
commit 816f75d018

View File

@@ -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);