diff options
author | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2023-07-17 08:54:58 +0200 |
---|---|---|
committer | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2023-08-26 18:54:46 +0200 |
commit | 127c66c3b95feddda664d1d76cae424a592ceac5 (patch) | |
tree | 709f868152e32d6eebb66525343fe5c7a1777aa1 /drivers/pci/endpoint/functions | |
parent | PCI: epf-mhi: Add support for SM8450 (diff) | |
download | linux-127c66c3b95feddda664d1d76cae424a592ceac5.tar.xz linux-127c66c3b95feddda664d1d76cae424a592ceac5.zip |
PCI: epf-mhi: Use iATU for small transfers
For transfers below 4K, let's use iATU since using eDMA for such small
transfers is inefficient.
This is mainly because setting up an eDMA transfer and waiting for
completion adds some latency. This latency is negligible for large
transfers but not for the smaller ones.
With using iATU, there is an increase in ~50Mbps throughput on both MHI
UL (Uplink) and DL (Downlink) channels.
[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20230717065459.14138-7-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Diffstat (limited to 'drivers/pci/endpoint/functions')
-rw-r--r-- | drivers/pci/endpoint/functions/pci-epf-mhi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index fec9743a63f0..b7b9d3e21f97 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -284,6 +284,9 @@ static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from, dma_addr_t dst_addr; int ret; + if (size < SZ_4K) + return pci_epf_mhi_iatu_read(mhi_cntrl, from, to, size); + mutex_lock(&epf_mhi->lock); config.direction = DMA_DEV_TO_MEM; @@ -350,6 +353,9 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, void *from, dma_addr_t src_addr; int ret; + if (size < SZ_4K) + return pci_epf_mhi_iatu_write(mhi_cntrl, from, to, size); + mutex_lock(&epf_mhi->lock); config.direction = DMA_MEM_TO_DEV; |