Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-29 Thread Vinod Koul
On Mon, Jul 22, 2013 at 08:10:06PM +0200, Sebastian Andrzej Siewior wrote: In USB RX path it is possible that the we receive less bytes than requested. Take the following example: The driver for USB-to-UART submits an URB with 256 bytes in size and the dmaengine driver in turn programs a

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-29 Thread Sebastian Andrzej Siewior
On 07/29/2013 01:39 PM, Vinod Koul wrote: @@ -416,6 +418,7 @@ struct dma_async_tx_descriptor { dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); dma_async_tx_callback callback; void *callback_param; +unsigned int transfered; I think this should be doable with

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-26 Thread Sebastian Andrzej Siewior
On Thu, Jul 25, 2013 at 05:32:35PM +0200, Lars-Peter Clausen wrote: I see. But it can't be reused before calling the callback if it is going to call the callback, right? So if this is a no-no, I'm left with an additional argument to the complete callback? Hm, maybe using

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-25 Thread Lars-Peter Clausen
On 07/22/2013 08:10 PM, Sebastian Andrzej Siewior wrote: In USB RX path it is possible that the we receive less bytes than requested. Take the following example: The driver for USB-to-UART submits an URB with 256 bytes in size and the dmaengine driver in turn programs a transfer of 256 bytes.

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-25 Thread Sebastian Andrzej Siewior
On 07/25/2013 04:57 PM, Lars-Peter Clausen wrote: I'm not sure that this will work. Once you've submitted the descriptor it is owned by the dmaengine driver and you are not allowed to dereference it anymore since the dmaengine driver might free the memory at any time. You should only reference

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-23 Thread Sebastian Andrzej Siewior
On 07/22/2013 08:52 PM, Sergei Shtylyov wrote: @@ -416,6 +418,7 @@ struct dma_async_tx_descriptor { dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); dma_async_tx_callback callback; void *callback_param; +unsigned int transfered; Correct grammar is

[PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-22 Thread Sebastian Andrzej Siewior
In USB RX path it is possible that the we receive less bytes than requested. Take the following example: The driver for USB-to-UART submits an URB with 256 bytes in size and the dmaengine driver in turn programs a transfer of 256 bytes. The transfer is programmed and the dma engine waits for the

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-22 Thread Sergei Shtylyov
On 07/22/2013 10:10 PM, Sebastian Andrzej Siewior wrote: In USB RX path it is possible that the we receive less bytes than requested. Take the following example: The driver for USB-to-UART submits an URB with 256 bytes in size and the dmaengine driver in turn programs a transfer of 256 bytes.