| 9e24bdfe | 06-Nov-2025 |
Marco Crivellari <marco.crivellari@suse.com> |
bus: mhi: ep: add WQ_PERCPU to alloc_workqueue users
Currently if a user enqueue a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use WORK
bus: mhi: ep: add WQ_PERCPU to alloc_workqueue users
Currently if a user enqueue a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to schedule_work() that is using system_wq and queue_work(), that makes use again of WORK_CPU_UNBOUND. This lack of consistency cannot be addressed without refactoring the API.
alloc_workqueue() treats all queues as per-CPU by default, while unbound workqueues must opt-in via WQ_UNBOUND.
This default is suboptimal: most workloads benefit from unbound queues, allowing the scheduler to place worker threads where they’re needed and reducing noise when CPUs are isolated.
This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in:
commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
This change adds a new WQ_PERCPU flag to explicitly request alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.
With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND must now use WQ_PERCPU.
Once migration is complete, WQ_UNBOUND can be removed and unbound will become the implicit default.
Suggested-by: Tejun Heo <tj@kernel.org> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Link: https://patch.msgid.link/20251106162430.328701-1-marco.crivellari@suse.com
show more ...
|
| 309ab14f | 27-Nov-2023 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
bus: mhi: ep: Add checks for read/write callbacks while registering controllers
The MHI EP controller drivers has to support both sync and async read/write callbacks. Hence, add a check for it.
Sig
bus: mhi: ep: Add checks for read/write callbacks while registering controllers
The MHI EP controller drivers has to support both sync and async read/write callbacks. Hence, add a check for it.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
show more ...
|
| 2547beb0 | 21-Aug-2023 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
bus: mhi: ep: Add support for async DMA read operation
As like the async DMA write operation, let's add support for async DMA read operation. In the async path, the data will be read from the transf
bus: mhi: ep: Add support for async DMA read operation
As like the async DMA write operation, let's add support for async DMA read operation. In the async path, the data will be read from the transfer ring continuously and when the controller driver notifies the stack using the completion callback (mhi_ep_read_completion), then the client driver will be notified with the read data and the completion event will be sent to the host for the respective ring element (if requested by the host).
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
show more ...
|
| ee08acb5 | 02-Nov-2023 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
bus: mhi: ep: Add support for async DMA write operation
In order to optimize the data transfer, let's use the async DMA operation for writing (queuing) data to the host.
In the async path, the comp
bus: mhi: ep: Add support for async DMA write operation
In order to optimize the data transfer, let's use the async DMA operation for writing (queuing) data to the host.
In the async path, the completion event for the transfer ring will only be sent to the host when the controller driver notifies the MHI stack of the actual transfer completion using the callback (mhi_ep_skb_completion) supplied in "struct mhi_ep_buf_info".
Also to accommodate the async operation, the transfer ring read offset (ring->rd_offset) is cached in the "struct mhi_ep_chan" and updated locally to let the stack queue further ring items to the controller driver. But the actual read offset of the transfer ring will only be updated in the completion callback.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
show more ...
|
| 92710524 | 27-Nov-2023 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
bus: mhi: ep: Rename read_from_host() and write_to_host() APIs
In the preparation for adding async API support, let's rename the existing APIs to read_sync() and write_sync() to make it explicit tha
bus: mhi: ep: Rename read_from_host() and write_to_host() APIs
In the preparation for adding async API support, let's rename the existing APIs to read_sync() and write_sync() to make it explicit that these APIs are used for synchronous read/write.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
show more ...
|
| b08ded2e | 17-Aug-2023 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs
In the preparation of DMA async support, let's pass the parameters to read_from_host() and write_to_host() APIs using mhi_ep_buf_info str
bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs
In the preparation of DMA async support, let's pass the parameters to read_from_host() and write_to_host() APIs using mhi_ep_buf_info structure.
No functional change.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
show more ...
|
| cea4bcbf | 26-Oct-2023 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
bus: mhi: ep: Add support for interrupt moderation timer
MHI spec defines the interrupt moderation timer feature using which the host can limit the number of interrupts being raised for an event rin
bus: mhi: ep: Add support for interrupt moderation timer
MHI spec defines the interrupt moderation timer feature using which the host can limit the number of interrupts being raised for an event ring by the device. This feature allows the host to process multiple event ring elements by a single IRQ from the device, thereby eliminating the need to process IRQ for each element.
The INTMODT field in the event context array provides the value to be used for delaying the IRQ generation from device. This value, along with the Block Event Interrupt (BEI) flag of the TRE defines how IRQ is generated to the host.
Support for interrupt moderation timer is implemented using delayed workqueue in kernel. And a separate delayed work item is used for each event ring.
Link: https://lore.kernel.org/r/20231026045513.12981-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
show more ...
|