summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2023-11-02 18:03:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-17 16:24:10 +0300
commitb6af3a95417b91d2fd519deb0bb7c03729012877 (patch)
tree7e26044548a2fccd459cb00173b18b8867888eca /include
parenta77e5950f93fbef4d4314ffbd652fe199c6c0592 (diff)
downloadlinux-b6af3a95417b91d2fd519deb0bb7c03729012877.tar.xz
bus: mhi: ep: Add support for async DMA write operation
[ Upstream commit ee08acb58fe47fc3bc2c137965985cdb1df40b35 ] 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> Stable-dep-of: c7d0b2db5bc5 ("bus: mhi: ep: Do not allocate memory for MHI objects from DMA zone") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mhi_ep.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/mhi_ep.h b/include/linux/mhi_ep.h
index 14c6e8d3f573..11bf3212f782 100644
--- a/include/linux/mhi_ep.h
+++ b/include/linux/mhi_ep.h
@@ -51,16 +51,20 @@ struct mhi_ep_db_info {
/**
* struct mhi_ep_buf_info - MHI Endpoint transfer buffer info
+ * @mhi_dev: MHI device associated with this buffer
* @dev_addr: Address of the buffer in endpoint
* @host_addr: Address of the bufffer in host
* @size: Size of the buffer
+ * @code: Transfer completion code
* @cb: Callback to be executed by controller drivers after transfer completion (async)
* @cb_buf: Opaque buffer to be passed to the callback
*/
struct mhi_ep_buf_info {
+ struct mhi_ep_device *mhi_dev;
void *dev_addr;
u64 host_addr;
size_t size;
+ int code;
void (*cb)(struct mhi_ep_buf_info *buf_info);
void *cb_buf;