On Thu, Jul 18, 2013 at 01:21:55PM +0200, Sebastian Andrzej Siewior wrote:
> On 07/11/2013 07:14 PM, Sebastian Andrzej Siewior wrote:
>
> Dan, Vinod,
>
> do you guys have an idea how the dma driver could inform its user how
> much of the requested data got really transferred? This requirement
> seems unique to USB where this happens and is not an error. Below an
> reply to Greg where I tried to explain the problem. The original thread
> started at [0].
> I've been browsing by some drivers and did not find anything close to
> this. The UART drivers which use DMA seem to know the exact number of
> bytes in advance. The dmaengine_tx_status() seems to serve a different
> purpose.
Please look into the residue field
/**
* struct dma_tx_state - filled in to report the status of
* a transfer.
* @last: last completed DMA cookie
* @used: last issued DMA cookie (i.e. the one in progress)
* @residue: the remaining number of bytes left to transmit
* on the selected transfer for states DMA_IN_PROGRESS and
* DMA_PAUSED if this is implemented in the driver, else 0
*/
struct dma_tx_state {
dma_cookie_t last;
dma_cookie_t used;
u32 residue;
};
Typically this is set to 0 when DMA_SUCCESS is returned for the
dmaengine_tx_status() API. But in your case I feel its perfectly valid to return
DMA_SUCCESS but with a non zero residue indiactaing how much was not transmitted
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html