[PATCH 2 1/4] RFC: dmaengine: Add error reporting infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adding a callback function that provides a way to report
transation error and residue DMA data.

Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
---
 include/linux/dmaengine.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 30de019..abb8440 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -440,6 +440,7 @@ void dma_chan_cleanup(struct kref *kref);
 typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
 
 typedef void (*dma_async_tx_callback)(void *dma_async_param);
+typedef struct dma_results * (*dma_async_tx_with_err_callback)(void *dma_async_param);
 
 struct dmaengine_unmap_data {
 	u8 map_cnt;
@@ -452,6 +453,18 @@ struct dmaengine_unmap_data {
 	dma_addr_t addr[0];
 };
 
+enum dma_trans_error {
+	DMA_TRANS_NOERROR = 0,
+	DMA_TRANS_READ_FAILED,
+	DMA_TRANS_WRITE_FAILED,
+	DMA_TRANS_ABORTED,
+};
+
+struct dma_results {
+	enum dma_trans_error result;
+	u32 residue;
+};
+
 /**
  * struct dma_async_tx_descriptor - async transaction descriptor
  * ---dma generic offload fields---
@@ -478,6 +491,7 @@ struct dma_async_tx_descriptor {
 	dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
 	int (*desc_free)(struct dma_async_tx_descriptor *tx);
 	dma_async_tx_callback callback;
+	dma_async_tx_with_err_callback callback_result;
 	void *callback_param;
 	struct dmaengine_unmap_data *unmap;
 #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux