[PATCH v4 3/4] dma: mmp_pdma: add support for residue reporting

Russell King - ARM Linux linux at arm.linux.org.uk
Sun Aug 25 13:01:51 EDT 2013


On Sun, Aug 25, 2013 at 09:41:04PM +0530, Vinod Koul wrote:
> Also descriptor is returned for a transaction when you invoke .device_prep_xxx.
> And each descriptor is assigned a cookie value.

The descriptor is not assigned a cookie in the preparation function - it
is only assigned a cookie when it is submitted, which should always happen
shortly after preparation.  The submission call returns the assigned
cookie, so there's no reason for any driver to dereference the descriptor.

Any driver which does dereference the descriptor after submission is
potentially a bug; the DMA engine owns it, and can kfree that descriptor
any moment after submission, or even re-use it for another descriptor.



More information about the linux-arm-kernel mailing list