[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d4e049b-737c-3904-2bb1-6e058ab69a4d@ti.com>
Date: Wed, 9 Oct 2019 10:37:09 +0300
From: Tero Kristo <t-kristo@...com>
To: Peter Ujfalusi <peter.ujfalusi@...com>, <vkoul@...nel.org>,
<robh+dt@...nel.org>, <nm@...com>, <ssantosh@...nel.org>
CC: <dan.j.williams@...el.com>, <dmaengine@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<grygorii.strashko@...com>, <lokeshvutla@...com>,
<tony@...mide.com>, <j-keerthy@...com>
Subject: Re: [PATCH v3 04/14] dmaengine: Add metadata_ops for
dma_async_tx_descriptor
On 01/10/2019 09:16, Peter Ujfalusi wrote:
> The metadata is best described as side band data or parameters traveling
> alongside the data DMAd by the DMA engine. It is data
> which is understood by the peripheral and the peripheral driver only, the
> DMA engine see it only as data block and it is not interpreting it in any
> way.
>
> The metadata can be different per descriptor as it is a parameter for the
> data being transferred.
>
> If the DMA supports per descriptor metadata it can implement the attach,
> get_ptr/set_len callbacks.
>
> Client drivers must only use either attach or get_ptr/set_len to avoid
> misconfiguration.
>
> Client driver can check if a given metadata mode is supported by the
> channel during probe time with
> dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_CLIENT);
> dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_ENGINE);
>
> and based on this information can use either mode.
>
> Wrappers are also added for the metadata_ops.
>
> To be used in DESC_METADATA_CLIENT mode:
> dmaengine_desc_attach_metadata()
>
> To be used in DESC_METADATA_ENGINE mode:
> dmaengine_desc_get_metadata_ptr()
> dmaengine_desc_set_metadata_len()
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
Again couple of typos below, but other than that:
Reviewed-by: Tero Kristo <t-kristo@...com>
> ---
> drivers/dma/dmaengine.c | 73 ++++++++++++++++++++++++++
> include/linux/dmaengine.h | 108 ++++++++++++++++++++++++++++++++++++++
<snip>
> + * @DESC_METADATA_ENGINE - the metadata buffer is allocated/managed by the DMA
> + * driver. The client driver can ask for the pointer, maximum size and the
> + * currently used size of the metadata and can directly update or read it.
> + * dmaengine_desc_get_metadata_ptr() and dmaengine_desc_set_metadata_len() is
> + * provided as helper functions.
> + *
> + * Client drivers interested to use this mode can follow:
> + * - DMA_MEM_TO_DEV / DEV_MEM_TO_MEM:
> + * 1. prepare the descriptor (dmaengine_prep_*)
> + * 2. use dmaengine_desc_get_metadata_ptr() to get the pointer to the engine's
> + * metadata area
> + * 3. update the metadata at the pointer
> + * 4. use dmaengine_desc_set_metadata_len() to tell the DMA engine the amount
> + * of data the client has placed into the metadata buffer
> + * 5. submit the transfer
> + * - DMA_DEV_TO_MEM:
> + * 1. prepare the descriptor (dmaengine_prep_*)
> + * 2. submit the transfer
> + * 3. on transfer completion, use dmaengine_desc_get_metadata_ptr() to get the
> + * pointer to the engine's metadata are
are = area?
> + * 4. Read out the metadate from the pointer
metadate = metadata?
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Powered by blists - more mailing lists