Thread (36 messages) 36 messages, 5 authors, 2019-12-23

Re: [PATCH v7 04/12] dmaengine: Add metadata_ops for dma_async_tx_descriptor

From: Peter Ujfalusi <hidden>
Date: 2019-12-20 08:48:02
Also in: dmaengine, linux-devicetree, lkml

Hi Vinod,

On 20/12/2019 10.32, Vinod Koul wrote:
Hi Peter,

On 09-12-19, 11:43, Peter Ujfalusi wrote:
quoted
+int dmaengine_desc_attach_metadata(struct dma_async_tx_descriptor *desc,
+				   void *data, size_t len)
+{
+	int ret;
+
+	if (!desc)
+		return -EINVAL;
+
+	ret = desc_check_and_set_metadata_mode(desc, DESC_METADATA_CLIENT);
+	if (ret)
+		return ret;
+
+	if (!desc->metadata_ops || !desc->metadata_ops->attach)
+		return -ENOTSUPP;
+
+	return desc->metadata_ops->attach(desc, data, len);
this looks good to me, only thing is we should check if people are
mixing the modes :)
desc_check_and_set_metadata_mode() does the checking to make sure that
the modes are not mixed.

- Péter

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help