Skip to contentSkip to conversation

dmaengine: Add support for per xfer specific privatedata

PATCH Superseded Ravi Kumar V 2 participants 4 messages Mar 12, 2012 – Mar 15, 2012

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dmaengine: Add support for per xfer specific privatedata

Add new argument to DMA SG and Interleave mode for passing per transfer specific private data, using this it enables the dma devices which needs to pass the parameters which changes per each transfer.

---
 include/linux/dmaengine.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/dmaengine.h +2 -2
index 679b349..b8f0495 100644
@@ -570,7 +570,7 @@ struct dma_device {
 		struct dma_chan *chan,
 		struct scatterlist *dst_sg, unsigned int dst_nents,
 		struct scatterlist *src_sg, unsigned int src_nents,
-		unsigned long flags);
+		unsigned long flags, void *context);
 
 	struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
 		struct dma_chan *chan, struct scatterlist *sgl,
@@ -581,7 +581,7 @@ struct dma_device {
 		size_t period_len, enum dma_transfer_direction direction);
 	struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
 		struct dma_chan *chan, struct dma_interleaved_template *xt,
-		unsigned long flags);
+		unsigned long flags, void *context);
 	int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 		unsigned long arg);
 
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw
Quoted 15 lines · Ravi Kumar V

Add new argument to DMA SG and Interleave mode for passing per transfer specific private data, using this it enables the dma devices which needs to pass the parameters which changes per each transfer.

---
 include/linux/dmaengine.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/dmaengine.h +0 -0
index 679b349..b8f0495 100644

include/linux/dmaengine.h struct dma_device { · line 573

Quoted 5 lines
include/linux/dmaengine.h +1 -1
@@ -570,7 +570,7 @@ struct dma_device {
 		struct dma_chan *chan,
 		struct scatterlist *dst_sg, unsigned int dst_nents,
 		struct scatterlist *src_sg, unsigned int src_nents,
-		unsigned long flags);
+		unsigned long flags, void *context);

Please follow the related discussion we had. Alexandre had already posted updated and this needs to follow.
Also this way you break the existing drivers which use this API, not sure why you posted without fixing them?

Quoted 11 lines
include/linux/dmaengine.h +1 -1
 	struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
 		struct dma_chan *chan, struct scatterlist *sgl,
@@ -581,7 +581,7 @@ struct dma_device {
 		size_t period_len, enum dma_transfer_direction direction);
 	struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
 		struct dma_chan *chan, struct dma_interleaved_template *xt,
-		unsigned long flags);
+		unsigned long flags, void *context);
 	int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 		unsigned long arg);
 
Signature · 1 line
~Vinod
#2 lore raw
Quoted 11 lines · Vinod Koul
Quoted 10 lines · Ravi Kumar V

Add new argument to DMA SG and Interleave mode for passing per transfer specific private data, using this it enables the dma devices which needs to pass the parameters which changes per each transfer.

---
  include/linux/dmaengine.h |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

include/linux/dmaengine.h struct dma_device { · line 573

Quoted 10 lines
include/linux/dmaengine.h +1 -1
index 679b349..b8f0495 100644
@@ -570,7 +570,7 @@ struct dma_device {
  		struct dma_chan *chan,
  		struct scatterlist *dst_sg, unsigned int dst_nents,
  		struct scatterlist *src_sg, unsigned int src_nents,
-		unsigned long flags);
+		unsigned long flags, void *context);

Please follow the related discussion we had. Alexandre had already posted updated and this needs to follow.
Also this way you break the existing drivers which use this API, not sure why you posted without fixing them?

I have gone through the discussion in
https://lkml.org/lkml/2012/2/6/300
As per my understanding
1.we need to add new transaction types DMA_SG_EXT & DMA_INTERLEAVE_EXT. 2.Add context parameter to existing API's.
3.Typecast the context parameter with architecture specific structure there by restricting client drivers to pass only arch specific parameter. 4.Fix existing code and client drivers for using new API.

My suggestion is instead of adding context parameter in existing API's, how it would be if we can add a new API for each DMA transaction types available in dmaengine for passing transaction specific parameter? so that existing clients and dma drivers will not be disturbed.

Quoted 13 lines
Quoted 11 lines
include/linux/dmaengine.h +1 -1
  	struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
  		struct dma_chan *chan, struct scatterlist *sgl,
@@ -581,7 +581,7 @@ struct dma_device {
  		size_t period_len, enum dma_transfer_direction direction);
  	struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
  		struct dma_chan *chan, struct dma_interleaved_template *xt,
-		unsigned long flags);
+		unsigned long flags, void *context);
  	int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
  		unsigned long arg);
 
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw
Quoted 12 lines · Ravi Kumar V
Quoted 11 lines · Vinod Koul
Quoted 10 lines · Ravi Kumar V

Add new argument to DMA SG and Interleave mode for passing per transfer specific private data, using this it enables the dma devices which needs to pass the parameters which changes per each transfer.

---
include/linux/dmaengine.h | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
include/linux/dmaengine.h +0 -0
index 679b349..b8f0495 100644
@@ -570,7 +570,7 @@ struct dma_device {
 struct dma_chan *chan,
Quoted 9 lines

include/linux/dmaengine.h struct dma_device { · line 573

Quoted 4 lines
include/linux/dmaengine.h +1 -1
 struct scatterlist *dst_sg, unsigned int dst_nents,
 struct scatterlist *src_sg, unsigned int src_nents,
- unsigned long flags);
+ unsigned long flags, void *context);

Please follow the related discussion we had. Alexandre had already posted updated and this needs to follow.
Also this way you break the existing drivers which use this API, not sure why you posted without fixing them?

I have gone through the discussion in
https://lkml.org/lkml/2012/2/6/300
As per my understanding
1.we need to add new transaction types DMA_SG_EXT & DMA_INTERLEAVE_EXT. 2.Add context parameter to existing API's.
3.Typecast the context parameter with architecture specific structure there by restricting client drivers to pass only arch specific parameter. 4.Add inline functions as suggested by Russell
and then
5.Fix existing code and client drivers for using new API.

Hi Vinod,

I am ready to follow above steps and also suggested by Russell and submit new patch.
Please can you confirm me so that i will start work.

My suggestion is instead of adding context parameter in existing API's, how it would be if we can add a new API for each DMA transaction types available in dmaengine for passing transaction specific parameter? so that existing clients and dma drivers will not be disturbed.

Thanks
Ravi Kumar

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.