linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] dmaengine: Add per descriptor metadata support
@ 2018-09-12  6:45 Peter Ujfalusi
  2018-09-12  6:45 ` [PATCH v3 1/2] dmaengine: doc: Add sections for " Peter Ujfalusi
  2018-09-12  6:45 ` [PATCH v3 2/2] dmaengine: Add metadata_ops for dma_async_tx_descriptor Peter Ujfalusi
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2018-09-12  6:45 UTC (permalink / raw)
  To: dan.j.williams, vkoul; +Cc: dmaengine, linux-kernel, lars, radheys

Hi,

Changes since v2:
- EXPORT_SYMBOL_GPL() for the metadata functions
- Added note to Documentation to not mix the two defined metadata modes
- Fixed the typos in Documentation

Changes since v1:
- Move code from header to dmaengine.c
- Fix spelling
- Use BIT() macro for bit definition
- Update both provider and client documentation

Changes since rfc:
- DESC_METADATA_EMBEDDED renamed to DESC_METADATA_ENGINE
- Use flow is added for both CLIENT and ENGINE metadata modes

Some data movement architecure (DMA controller and peripherals) uses metadata
associated with a transaction. The DMA controller role is to transfer the
payload and the metadata alongside.
The metadata itself is not used by the DMA engine itself, but it contains
parameters, keys, vectors, etc for peripheral or from the peripheral.

The DMAengine framework provides a generic ways to facilitate the metadata for
descriptors. Depending on the architecture the DMA driver can implment either
or both of the methods and it is up to the client driver to choose which one
to use.

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
miss configuration.

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()

Regards,
Peter
---
Peter Ujfalusi (2):
  dmaengine: doc: Add sections for per descriptor metadata support
  dmaengine: Add metadata_ops for dma_async_tx_descriptor

 Documentation/driver-api/dmaengine/client.rst |  75 ++++++++++++
 .../driver-api/dmaengine/provider.rst         |  46 ++++++++
 drivers/dma/dmaengine.c                       |  73 ++++++++++++
 include/linux/dmaengine.h                     | 108 ++++++++++++++++++
 4 files changed, 302 insertions(+)

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-12  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12  6:45 [PATCH v3 0/2] dmaengine: Add per descriptor metadata support Peter Ujfalusi
2018-09-12  6:45 ` [PATCH v3 1/2] dmaengine: doc: Add sections for " Peter Ujfalusi
2018-09-12  6:45 ` [PATCH v3 2/2] dmaengine: Add metadata_ops for dma_async_tx_descriptor Peter Ujfalusi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).