diff options
| author | Rajeev Kumar <rajekuma@codeaurora.org> | 2017-03-30 12:27:42 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-06 14:19:37 -0700 |
| commit | 1466e9a9498501485ea2ff35ded1a64096b56525 (patch) | |
| tree | 2474813c09f0ec35c5a81a91386fa6c5ab39c22e | |
| parent | 3d3341c4df4217476a8af8cccd9c0a247aefa0d9 (diff) | |
qcacmn: Migrate WMI from shared work queue to dedicated work queue
WMI RX event processing is very critical for WLAN driver and today
we are using kernel's shared event work queue. Shared event work
queue is used by many drivers and if any work submitted in shared
work queue takes longer time to finish then it directly impacts WLAN
control path processing.
Define a dedicated work queue for WMI RX event processing and use
it for WMI RX event handling.
Change-Id: I8ee6ca5b4b20c3357d46f8b56943078a0a76977f
CRs-Fixed: 2029775
| -rw-r--r-- | wmi/inc/wmi_unified_priv.h | 3 | ||||
| -rw-r--r-- | wmi/src/wmi_unified.c | 31 |
2 files changed, 25 insertions, 9 deletions
diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 9d968f2dcf00..7ded40c2c3b3 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1207,7 +1207,8 @@ struct wmi_unified { void *htc_handle; qdf_spinlock_t eventq_lock; qdf_nbuf_queue_t event_queue; - struct work_struct rx_event_work; + qdf_work_t rx_event_work; + qdf_workqueue_t *wmi_rx_work_queue; int wmi_stop_in_progress; #ifndef WMI_NON_TLV_SUPPORT struct _wmi_abi_version fw_abi_version; diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index f91863aab3eb..9e4b2365181b 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1384,7 +1384,9 @@ static void wmi_process_fw_event_worker_thread_ctx qdf_spin_lock_bh(&wmi_handle->eventq_lock); qdf_nbuf_queue_add(&wmi_handle->event_queue, evt_buf); qdf_spin_unlock_bh(&wmi_handle->eventq_lock); - schedule_work(&wmi_handle->rx_event_work); + qdf_queue_work(0, wmi_handle->wmi_rx_work_queue, + &wmi_handle->rx_event_work); + return; } @@ -1527,17 +1529,16 @@ end: /** * wmi_rx_event_work() - process rx event in rx work queue context - * @work: rx work queue struct + * @arg: opaque pointer to wmi handle * * This function process any fw event to serialize it through rx worker thread. * * Return: none */ -static void wmi_rx_event_work(struct work_struct *work) +static void wmi_rx_event_work(void *arg) { - struct wmi_unified *wmi = container_of(work, struct wmi_unified, - rx_event_work); wmi_buf_t buf; + struct wmi_unified *wmi = arg; qdf_spin_lock_bh(&wmi->eventq_lock); buf = qdf_nbuf_queue_remove(&wmi->event_queue); @@ -1622,7 +1623,14 @@ void *wmi_unified_attach(void *scn_handle, wmi_runtime_pm_init(wmi_handle); qdf_spinlock_create(&wmi_handle->eventq_lock); qdf_nbuf_queue_init(&wmi_handle->event_queue); - INIT_WORK(&wmi_handle->rx_event_work, wmi_rx_event_work); + qdf_create_work(0, &wmi_handle->rx_event_work, + wmi_rx_event_work, wmi_handle); + wmi_handle->wmi_rx_work_queue = + qdf_create_workqueue("wmi_rx_event_work_queue"); + if (NULL == wmi_handle->wmi_rx_work_queue) { + WMI_LOGE("failed to create wmi_rx_event_work_queue"); + goto error; + } #ifdef WMI_INTERFACE_EVENT_LOGGING if (QDF_STATUS_SUCCESS == wmi_log_init(wmi_handle)) { wmi_debugfs_init(wmi_handle); @@ -1643,6 +1651,11 @@ void *wmi_unified_attach(void *scn_handle, qdf_spinlock_create(&wmi_handle->ctx_lock); return wmi_handle; + +error: + qdf_mem_free(wmi_handle); + + return NULL; } /** @@ -1656,7 +1669,8 @@ void wmi_unified_detach(struct wmi_unified *wmi_handle) { wmi_buf_t buf; - cancel_work_sync(&wmi_handle->rx_event_work); + qdf_flush_workqueue(0, wmi_handle->wmi_rx_work_queue); + qdf_destroy_workqueue(0, wmi_handle->wmi_rx_work_queue); wmi_debugfs_remove(wmi_handle); @@ -1692,7 +1706,8 @@ wmi_unified_remove_work(struct wmi_unified *wmi_handle) { wmi_buf_t buf; - cancel_work_sync(&wmi_handle->rx_event_work); + qdf_flush_workqueue(0, wmi_handle->wmi_rx_work_queue); + qdf_spin_lock_bh(&wmi_handle->eventq_lock); buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); while (buf) { |
