Re: [PATCH v2 4/5] PCI: epf-mhi: Add batched DMA read support
From: Frank Li
Date: Tue Sep 29 2026 - 10:11:27 EST
On Sat, Sep 26, 2026 at 10:49:04AM +0200, Manivannan Sadhasivam wrote:
> On Tue, Sep 15, 2026 at 10:42:39AM +0530, Sumit Kumar wrote:
> >
> >
> > On 8/14/2026 8:22 PM, Manivannan Sadhasivam wrote:
> > > On Thu, Aug 06, 2026 at 12:11:34PM -0500, Frank Li wrote:
> > >
> > > [...]
> > >
> > > > > + config.direction = DMA_DEV_TO_MEM;
> > > > > + ret = dmaengine_slave_config(chan, &config);
> > > > > + if (ret) {
> > > > > + dev_err(dev, "Failed to configure DMA channel for %u-buffer batch read: %d\n",
> > > > > + num_buffers, ret);
> > > > > + goto err_unmap;
> > > > > + }
> > > > > +
> > > > > + desc = dmaengine_prep_dma_sg(chan, dst_sg, num_buffers,
> > > > > + src_sg, num_buffers,
> > > > > + DMA_CTRL_ACK | DMA_PREP_INTERRUPT);
> > > > Although both side memory address, but as previous discussion, which is not
> > > > memcpy, still memory to IO space transfer.
> > > >
> > > I agree, it is peripheral DMA nevertheless.
> > >
> > > > Maybe enhence device_prep_peripheral_dma_vec(). Actually eDMA still split
> > > > it to small trunk and linked together.
> > > >
> > > By enhance you mean keeping the semantics of device_prep_peripheral_dma_vec()
> > > API? I don't know how it helps because we would most likely end up with two
> > > vector arguments and duplicating scatter-gather lists.
> > Frank can you comment on this.
>
> Frank, ping!
I understand your requirement. It is not easy to handle. EP transfer is
actually it is two memory space (even one side is IO space). two sgs needs
consider offset is difference at both side, and total sg is difference,
which is quite common, dma_map_sg() can conbine continue address to one.
At lease need help function to easily convert to DMA's description list.
Let me think more.
Frank
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்