PCI: epf-mhi: Add support for DMA async read/write operation
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 2 Nov 2023 14:33:58 +0000 (20:03 +0530)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 14 Dec 2023 06:28:53 +0000 (11:58 +0530)
commit0d5d5738dc206e531d3a70c6a81fde4e9fa40b5d
treec68c1926b741496e23d85b5b0b3805ab3eb27794
parent5424be958b446601d6176396d9dbaad2178db610
PCI: epf-mhi: Add support for DMA async read/write operation

The driver currently supports only the sync read/write operation i.e., it
waits for the DMA transfer to complete before returning to the caller
(MHI stack). But it is sub-optimal and defeats the actual purpose of using
DMA.

So let's add support for DMA async read/write operation by skipping the DMA
transfer completion and returning to the caller immediately. When the
completion actually happens later, the driver will be notified using the
DMA completion handler and in turn it will notify the caller using the
newly introduced callback in "struct mhi_ep_buf_info".

Since the DMA completion handler is invoked from the interrupt context, a
separate workqueue (epf_mhi->dma_wq) is used to notify the caller about the
completion of the transfer.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Krzysztof WilczyƄski <kw@linux.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/endpoint/functions/pci-epf-mhi.c