From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: lpieralisi@kernel.org, kw@linux.com
Cc: kishon@kernel.org, bhelgaas@google.com, mhi@lists.linux.dev,
linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: [PATCH 3/9] bus: mhi: ep: Introduce async read/write callbacks
Date: Mon, 27 Nov 2023 18:15:23 +0530 [thread overview]
Message-ID: <20231127124529.78203-4-manivannan.sadhasivam@linaro.org> (raw)
In-Reply-To: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org>
These callbacks can be implemented by the controller drivers to perform
async read/write operation that increases the throughput.
For aiding the async operation, a completion callback is also introduced.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
include/linux/mhi_ep.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/mhi_ep.h b/include/linux/mhi_ep.h
index b96b543bf2f6..14c6e8d3f573 100644
--- a/include/linux/mhi_ep.h
+++ b/include/linux/mhi_ep.h
@@ -54,11 +54,16 @@ struct mhi_ep_db_info {
* @dev_addr: Address of the buffer in endpoint
* @host_addr: Address of the bufffer in host
* @size: Size of the buffer
+ * @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 {
void *dev_addr;
u64 host_addr;
size_t size;
+
+ void (*cb)(struct mhi_ep_buf_info *buf_info);
+ void *cb_buf;
};
/**
@@ -96,6 +101,8 @@ struct mhi_ep_buf_info {
* @unmap_free: CB function to unmap and free the allocated memory in endpoint for storing host context
* @read_sync: CB function for reading from host memory synchronously
* @write_sync: CB function for writing to host memory synchronously
+ * @read_async: CB function for reading from host memory asynchronously
+ * @write_async: CB function for writing to host memory asynchronously
* @mhi_state: MHI Endpoint state
* @max_chan: Maximum channels supported by the endpoint controller
* @mru: MRU (Maximum Receive Unit) value of the endpoint controller
@@ -151,6 +158,8 @@ struct mhi_ep_cntrl {
void __iomem *virt, size_t size);
int (*read_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
int (*write_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
+ int (*read_async)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
+ int (*write_async)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
enum mhi_state mhi_state;
--
2.25.1
next prev parent reply other threads:[~2023-11-27 12:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-27 12:45 [PATCH 0/9] bus: mhi: ep: Add async read/write support Manivannan Sadhasivam
2023-11-27 12:45 ` [PATCH 1/9] bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs Manivannan Sadhasivam
2023-11-27 12:45 ` [PATCH 2/9] bus: mhi: ep: Rename read_from_host() and write_to_host() APIs Manivannan Sadhasivam
2023-11-27 12:45 ` Manivannan Sadhasivam [this message]
2023-11-27 12:45 ` [PATCH 4/9] PCI: epf-mhi: Simulate async read/write using iATU Manivannan Sadhasivam
2023-12-13 18:49 ` Krzysztof Wilczyński
2023-11-27 12:45 ` [PATCH 5/9] PCI: epf-mhi: Add support for DMA async read/write operation Manivannan Sadhasivam
2023-12-13 18:50 ` Krzysztof Wilczyński
2023-11-27 12:45 ` [PATCH 6/9] PCI: epf-mhi: Enable MHI async read/write support Manivannan Sadhasivam
2023-12-13 18:48 ` Krzysztof Wilczyński
2023-12-14 5:19 ` Manivannan Sadhasivam
2023-12-14 9:40 ` Krishna Chaitanya Chundru
2023-12-14 10:09 ` Manivannan Sadhasivam
2023-12-14 10:14 ` Krishna Chaitanya Chundru
2023-12-14 10:47 ` Manivannan Sadhasivam
2023-12-14 10:54 ` Krishna Chaitanya Chundru
2023-11-27 12:45 ` [PATCH 7/9] bus: mhi: ep: Add support for async DMA write operation Manivannan Sadhasivam
2023-11-27 12:45 ` [PATCH 8/9] bus: mhi: ep: Add support for async DMA read operation Manivannan Sadhasivam
2023-11-27 12:45 ` [PATCH 9/9] bus: mhi: ep: Add checks for read/write callbacks while registering controllers Manivannan Sadhasivam
2023-12-13 19:31 ` [PATCH 0/9] bus: mhi: ep: Add async read/write support Bjorn Helgaas
2023-12-14 5:21 ` Manivannan Sadhasivam
2023-12-14 10:55 ` Manivannan Sadhasivam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231127124529.78203-4-manivannan.sadhasivam@linaro.org \
--to=manivannan.sadhasivam@linaro.org \
--cc=bhelgaas@google.com \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mhi@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).