bus: mhi: ep: Add support for async DMA write operation
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 2 Nov 2023 15:03:18 +0000 (20:33 +0530)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 15 Dec 2023 08:50:03 +0000 (14:20 +0530)
commitee08acb58fe47fc3bc2c137965985cdb1df40b35
tree6b73b5c9b785485cd6a8ef920e323c7a50a9f77c
parentd1c6f4ba4746ed41fde8269cb5fea88bddb60504
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>
drivers/bus/mhi/ep/internal.h
drivers/bus/mhi/ep/main.c
include/linux/mhi_ep.h