dmaengine: cookie bypass for out of order completion
authorDave Jiang <dave.jiang@intel.com>
Wed, 13 May 2020 18:47:49 +0000 (11:47 -0700)
committerVinod Koul <vkoul@kernel.org>
Wed, 17 Jun 2020 14:15:14 +0000 (19:45 +0530)
commit47ec7f09bc107720905c96bc37771e4ed1ff0aed
treed0d500633ad1d51812bc8ed04394e16859bc296c
parentc09a7ce668a666f1e044214647cb594940ba927c
dmaengine: cookie bypass for out of order completion

The cookie tracking in dmaengine expects all submissions completed in
order. Some DMA devices like Intel DSA can complete submissions out of
order, especially if configured with a work queue sharing multiple DMA
engines. Add a status DMA_OUT_OF_ORDER that tx_status can be returned for
those DMA devices. The user should use callbacks to track the completion
rather than the DMA cookie. This would address the issue of dmatest
complaining that descriptors are "busy" when the cookie count goes
backwards due to out of order completion. Add DMA_COMPLETION_NO_ORDER
DMA capability to allow the driver to flag the device's ability to complete
operations out of order.

Reported-by: Swathi Kovvuri <swathi.kovvuri@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Tested-by: Swathi Kovvuri <swathi.kovvuri@intel.com>
Link: https://lore.kernel.org/r/158939557151.20335.12404113976045569870.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Documentation/driver-api/dmaengine/provider.rst
drivers/dma/dmatest.c
drivers/dma/idxd/dma.c
include/linux/dmaengine.h