Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562772

Re: [PATCH 2/5] dmaengine: Add support for custom data mapping

From Andy Gross <andy.gross@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/5] dmaengine: Add support for custom data mapping
Date 2017-01-19 15:30 +0100
Message-ID <t1lSW-2E6-19@gated-at.bofh.it> (permalink)
References (5 earlier) <sQUU2-7y3-31@gated-at.bofh.it> <sTN9D-1eP-9@gated-at.bofh.it> <sVbMC-7WN-17@gated-at.bofh.it> <sVdv3-YY-11@gated-at.bofh.it> <t1d8Z-5va-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jan 19, 2017 at 10:31:50AM +0530, Vinod Koul wrote:

<snip>

> > > >
> > > >I really think that we need some additional API that allows for the flag
> > > >munging
> > > >for the descriptors instead of overriding the prep_slave_sg.  We already
> > > >needed
> > > >to change the way the flags are passed anyway.  And instead of building up
> > > >a
> > > >special sg list, the API should take a structure that has a 1:1 mapping of
> > > >the
> > > >flags to the descriptors.  And you would call this API on your descriptor
> > > >before
> > > >issuing it.
> 
> Munging wont be a good idea, but for some of the cases current flags can be
> used, and if need be, we can add additional flags

Is adding flags a possibility?  I tried to match up BAM flags to ones that made
sense that were currently defined, but adding a CMD flag would be kind of odd.

It was kind of a stretch to use the PREP_FENCE for the notify when done flag.

> > > >
> > > >So build up the sglist.  Call the prep_slave_sg.  You get back a tx
> > > >descriptor
> > > >that underneath is a bam descriptor.  Then call the API giving the
> > > >descriptor
> > > >and the structure that defines the flags for the descriptors.  Then submit
> > > >the
> > > >descriptor.
> > > >
> > > >Something like:
> > > >int qcom_bam_apply_descriptor_flags(struct dma_async_tx_descriptor *tx,
> > > >				    u16 *flags)
> > > >{
> > > >	struct bam_async_desc async_desc = container_of(tx,
> > > >							struct bam_async_desc,
> > > >							vd.tx);
> > > >	int i;
> > > >
> > > >	for (i = 0; i < async_desc->num_desc; i++)
> > > >		async_desc->desc[i].flags = cpu_to_le16(flags[i]);
> > > >}
> > > >
> > > >EXPORT_SYMBOL(qcom_bam_apply_descriptor_flags)
> 
> This makes it bam specific and causes issues if we want to use this code in
> generic libs, but yes this is an option but should be last resort.

If adding flags is a possibility (which it didn't seem to be in the past), that
would make things much easier.

Regards,

Andy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/5] dmaengine: Add support for custom data mapping Vinod Koul <vinod.koul@intel.com> - 2017-01-19 06:10 +0100
  Re: [PATCH 2/5] dmaengine: Add support for custom data mapping Andy Gross <andy.gross@linaro.org> - 2017-01-19 15:30 +0100
    Re: [PATCH 2/5] dmaengine: Add support for custom data mapping Abhishek Sahu <absahu@codeaurora.org> - 2017-01-19 16:00 +0100
    Re: [PATCH 2/5] dmaengine: Add support for custom data mapping Vinod Koul <vinod.koul@intel.com> - 2017-01-20 18:00 +0100

csiph-web