mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie in their private dma channel structures. This is pointless, and forces driver specific code. Move this out into the common dma_chan structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> [imx-sdma.c & mxs-dma.c] Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
This commit is contained in:
committed by
Vinod Koul
parent
08714f60b0
commit
4d4e58de32
@@ -49,7 +49,6 @@ struct iop_adma_device {
|
||||
/**
|
||||
* struct iop_adma_chan - internal representation of an ADMA device
|
||||
* @pending: allows batching of hardware operations
|
||||
* @completed_cookie: identifier for the most recently completed operation
|
||||
* @lock: serializes enqueue/dequeue operations to the slot pool
|
||||
* @mmr_base: memory mapped register base
|
||||
* @chain: device chain view of the descriptors
|
||||
@@ -62,7 +61,6 @@ struct iop_adma_device {
|
||||
*/
|
||||
struct iop_adma_chan {
|
||||
int pending;
|
||||
dma_cookie_t completed_cookie;
|
||||
spinlock_t lock; /* protects the descriptor slot pool */
|
||||
void __iomem *mmr_base;
|
||||
struct list_head chain;
|
||||
|
||||
@@ -971,7 +971,7 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan,
|
||||
u32 bytesleft = 0;
|
||||
|
||||
last_used = plchan->chan.cookie;
|
||||
last_complete = plchan->lc;
|
||||
last_complete = plchan->chan.completed_cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
if (ret == DMA_SUCCESS) {
|
||||
@@ -983,7 +983,7 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan,
|
||||
* This cookie not complete yet
|
||||
*/
|
||||
last_used = plchan->chan.cookie;
|
||||
last_complete = plchan->lc;
|
||||
last_complete = plchan->chan.completed_cookie;
|
||||
|
||||
/* Get number of bytes left in the active transactions and queue */
|
||||
bytesleft = pl08x_getbytes_chan(plchan);
|
||||
@@ -1543,7 +1543,7 @@ static void pl08x_tasklet(unsigned long data)
|
||||
|
||||
if (txd) {
|
||||
/* Update last completed */
|
||||
plchan->lc = txd->tx.cookie;
|
||||
plchan->chan.completed_cookie = txd->tx.cookie;
|
||||
}
|
||||
|
||||
/* If a new descriptor is queued, set it up plchan->at is NULL here */
|
||||
@@ -1725,7 +1725,7 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x,
|
||||
|
||||
chan->chan.device = dmadev;
|
||||
chan->chan.cookie = 0;
|
||||
chan->lc = 0;
|
||||
chan->chan.completed_cookie = 0;
|
||||
|
||||
spin_lock_init(&chan->lock);
|
||||
INIT_LIST_HEAD(&chan->pend_list);
|
||||
|
||||
@@ -269,7 +269,7 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc)
|
||||
dev_vdbg(chan2dev(&atchan->chan_common),
|
||||
"descriptor %u complete\n", txd->cookie);
|
||||
|
||||
atchan->completed_cookie = txd->cookie;
|
||||
atchan->chan_common.completed_cookie = txd->cookie;
|
||||
|
||||
/* move children to free_list */
|
||||
list_splice_init(&desc->tx_list, &atchan->free_list);
|
||||
@@ -1016,14 +1016,14 @@ atc_tx_status(struct dma_chan *chan,
|
||||
|
||||
spin_lock_irqsave(&atchan->lock, flags);
|
||||
|
||||
last_complete = atchan->completed_cookie;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
if (ret != DMA_SUCCESS) {
|
||||
atc_cleanup_descriptors(atchan);
|
||||
|
||||
last_complete = atchan->completed_cookie;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
@@ -1129,7 +1129,7 @@ static int atc_alloc_chan_resources(struct dma_chan *chan)
|
||||
spin_lock_irqsave(&atchan->lock, flags);
|
||||
atchan->descs_allocated = i;
|
||||
list_splice(&tmp_list, &atchan->free_list);
|
||||
atchan->completed_cookie = chan->cookie = 1;
|
||||
chan->completed_cookie = chan->cookie = 1;
|
||||
spin_unlock_irqrestore(&atchan->lock, flags);
|
||||
|
||||
/* channel parameters */
|
||||
@@ -1329,7 +1329,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
|
||||
struct at_dma_chan *atchan = &atdma->chan[i];
|
||||
|
||||
atchan->chan_common.device = &atdma->dma_common;
|
||||
atchan->chan_common.cookie = atchan->completed_cookie = 1;
|
||||
atchan->chan_common.cookie = atchan->chan_common.completed_cookie = 1;
|
||||
list_add_tail(&atchan->chan_common.device_node,
|
||||
&atdma->dma_common.channels);
|
||||
|
||||
|
||||
@@ -208,7 +208,6 @@ enum atc_status {
|
||||
* @save_dscr: for cyclic operations, preserve next descriptor address in
|
||||
* the cyclic list on suspend/resume cycle
|
||||
* @lock: serializes enqueue/dequeue operations to descriptors lists
|
||||
* @completed_cookie: identifier for the most recently completed operation
|
||||
* @active_list: list of descriptors dmaengine is being running on
|
||||
* @queue: list of descriptors ready to be submitted to engine
|
||||
* @free_list: list of descriptors usable by the channel
|
||||
@@ -227,7 +226,6 @@ struct at_dma_chan {
|
||||
spinlock_t lock;
|
||||
|
||||
/* these other elements are all protected by lock */
|
||||
dma_cookie_t completed_cookie;
|
||||
struct list_head active_list;
|
||||
struct list_head queue;
|
||||
struct list_head free_list;
|
||||
|
||||
@@ -59,7 +59,6 @@ struct coh901318_base {
|
||||
struct coh901318_chan {
|
||||
spinlock_t lock;
|
||||
int allocated;
|
||||
int completed;
|
||||
int id;
|
||||
int stopped;
|
||||
|
||||
@@ -705,7 +704,7 @@ static void dma_tasklet(unsigned long data)
|
||||
callback_param = cohd_fin->desc.callback_param;
|
||||
|
||||
/* sign this job as completed on the channel */
|
||||
cohc->completed = cohd_fin->desc.cookie;
|
||||
cohc->chan.completed_cookie = cohd_fin->desc.cookie;
|
||||
|
||||
/* release the lli allocation and remove the descriptor */
|
||||
coh901318_lli_free(&cohc->base->pool, &cohd_fin->lli);
|
||||
@@ -929,7 +928,7 @@ static int coh901318_alloc_chan_resources(struct dma_chan *chan)
|
||||
coh901318_config(cohc, NULL);
|
||||
|
||||
cohc->allocated = 1;
|
||||
cohc->completed = chan->cookie = 1;
|
||||
chan->completed_cookie = chan->cookie = 1;
|
||||
|
||||
spin_unlock_irqrestore(&cohc->lock, flags);
|
||||
|
||||
@@ -1169,7 +1168,7 @@ coh901318_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||
dma_cookie_t last_complete;
|
||||
int ret;
|
||||
|
||||
last_complete = cohc->completed;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
|
||||
@@ -249,7 +249,7 @@ dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc,
|
||||
dev_vdbg(chan2dev(&dwc->chan), "descriptor %u complete\n", txd->cookie);
|
||||
|
||||
spin_lock_irqsave(&dwc->lock, flags);
|
||||
dwc->completed = txd->cookie;
|
||||
dwc->chan.completed_cookie = txd->cookie;
|
||||
if (callback_required) {
|
||||
callback = txd->callback;
|
||||
param = txd->callback_param;
|
||||
@@ -997,14 +997,14 @@ dwc_tx_status(struct dma_chan *chan,
|
||||
dma_cookie_t last_complete;
|
||||
int ret;
|
||||
|
||||
last_complete = dwc->completed;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
if (ret != DMA_SUCCESS) {
|
||||
dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
|
||||
|
||||
last_complete = dwc->completed;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
@@ -1046,7 +1046,7 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dwc->completed = chan->cookie = 1;
|
||||
chan->completed_cookie = chan->cookie = 1;
|
||||
|
||||
/*
|
||||
* NOTE: some controllers may have additional features that we
|
||||
@@ -1474,7 +1474,7 @@ static int __init dw_probe(struct platform_device *pdev)
|
||||
struct dw_dma_chan *dwc = &dw->chan[i];
|
||||
|
||||
dwc->chan.device = &dw->dma;
|
||||
dwc->chan.cookie = dwc->completed = 1;
|
||||
dwc->chan.cookie = dwc->chan.completed_cookie = 1;
|
||||
if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING)
|
||||
list_add_tail(&dwc->chan.device_node,
|
||||
&dw->dma.channels);
|
||||
|
||||
@@ -158,7 +158,6 @@ struct dw_dma_chan {
|
||||
|
||||
/* these other elements are all protected by lock */
|
||||
unsigned long flags;
|
||||
dma_cookie_t completed;
|
||||
struct list_head active_list;
|
||||
struct list_head queue;
|
||||
struct list_head free_list;
|
||||
|
||||
@@ -122,7 +122,6 @@ struct ep93xx_dma_desc {
|
||||
* @lock: lock protecting the fields following
|
||||
* @flags: flags for the channel
|
||||
* @buffer: which buffer to use next (0/1)
|
||||
* @last_completed: last completed cookie value
|
||||
* @active: flattened chain of descriptors currently being processed
|
||||
* @queue: pending descriptors which are handled next
|
||||
* @free_list: list of free descriptors which can be used
|
||||
@@ -157,7 +156,6 @@ struct ep93xx_dma_chan {
|
||||
#define EP93XX_DMA_IS_CYCLIC 0
|
||||
|
||||
int buffer;
|
||||
dma_cookie_t last_completed;
|
||||
struct list_head active;
|
||||
struct list_head queue;
|
||||
struct list_head free_list;
|
||||
@@ -703,7 +701,7 @@ static void ep93xx_dma_tasklet(unsigned long data)
|
||||
desc = ep93xx_dma_get_active(edmac);
|
||||
if (desc) {
|
||||
if (desc->complete) {
|
||||
edmac->last_completed = desc->txd.cookie;
|
||||
edmac->chan.completed_cookie = desc->txd.cookie;
|
||||
list_splice_init(&edmac->active, &list);
|
||||
}
|
||||
callback = desc->txd.callback;
|
||||
@@ -861,7 +859,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
|
||||
goto fail_clk_disable;
|
||||
|
||||
spin_lock_irq(&edmac->lock);
|
||||
edmac->last_completed = 1;
|
||||
edmac->chan.completed_cookie = 1;
|
||||
edmac->chan.cookie = 1;
|
||||
ret = edmac->edma->hw_setup(edmac);
|
||||
spin_unlock_irq(&edmac->lock);
|
||||
@@ -1254,7 +1252,7 @@ static enum dma_status ep93xx_dma_tx_status(struct dma_chan *chan,
|
||||
|
||||
spin_lock_irqsave(&edmac->lock, flags);
|
||||
last_used = chan->cookie;
|
||||
last_completed = edmac->last_completed;
|
||||
last_completed = chan->completed_cookie;
|
||||
spin_unlock_irqrestore(&edmac->lock, flags);
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_completed, last_used);
|
||||
|
||||
@@ -990,7 +990,7 @@ static enum dma_status fsl_tx_status(struct dma_chan *dchan,
|
||||
|
||||
spin_lock_irqsave(&chan->desc_lock, flags);
|
||||
|
||||
last_complete = chan->completed_cookie;
|
||||
last_complete = dchan->completed_cookie;
|
||||
last_used = dchan->cookie;
|
||||
|
||||
spin_unlock_irqrestore(&chan->desc_lock, flags);
|
||||
@@ -1088,7 +1088,7 @@ static void dma_do_tasklet(unsigned long data)
|
||||
desc = to_fsl_desc(chan->ld_running.prev);
|
||||
cookie = desc->async_tx.cookie;
|
||||
|
||||
chan->completed_cookie = cookie;
|
||||
chan->common.completed_cookie = cookie;
|
||||
chan_dbg(chan, "completed_cookie=%d\n", cookie);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ struct fsldma_device {
|
||||
struct fsldma_chan {
|
||||
char name[8]; /* Channel name */
|
||||
struct fsldma_chan_regs __iomem *regs;
|
||||
dma_cookie_t completed_cookie; /* The maximum cookie completed */
|
||||
spinlock_t desc_lock; /* Descriptor operation lock */
|
||||
struct list_head ld_pending; /* Link descriptors queue */
|
||||
struct list_head ld_running; /* Link descriptors queue */
|
||||
|
||||
@@ -41,7 +41,6 @@ struct imxdma_channel {
|
||||
struct dma_chan chan;
|
||||
spinlock_t lock;
|
||||
struct dma_async_tx_descriptor desc;
|
||||
dma_cookie_t last_completed;
|
||||
enum dma_status status;
|
||||
int dma_request;
|
||||
struct scatterlist *sg_list;
|
||||
@@ -65,7 +64,7 @@ static void imxdma_handle(struct imxdma_channel *imxdmac)
|
||||
{
|
||||
if (imxdmac->desc.callback)
|
||||
imxdmac->desc.callback(imxdmac->desc.callback_param);
|
||||
imxdmac->last_completed = imxdmac->desc.cookie;
|
||||
imxdmac->chan.completed_cookie = imxdmac->desc.cookie;
|
||||
}
|
||||
|
||||
static void imxdma_irq_handler(int channel, void *data)
|
||||
@@ -158,8 +157,8 @@ static enum dma_status imxdma_tx_status(struct dma_chan *chan,
|
||||
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, imxdmac->last_completed, last_used);
|
||||
dma_set_tx_state(txstate, imxdmac->last_completed, last_used, 0);
|
||||
ret = dma_async_is_complete(cookie, chan->completed_cookie, last_used);
|
||||
dma_set_tx_state(txstate, chan->completed_cookie, last_used, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,6 @@ struct sdma_channel {
|
||||
struct dma_chan chan;
|
||||
spinlock_t lock;
|
||||
struct dma_async_tx_descriptor desc;
|
||||
dma_cookie_t last_completed;
|
||||
enum dma_status status;
|
||||
unsigned int chn_count;
|
||||
unsigned int chn_real_count;
|
||||
@@ -529,7 +528,7 @@ static void mxc_sdma_handle_channel_normal(struct sdma_channel *sdmac)
|
||||
else
|
||||
sdmac->status = DMA_SUCCESS;
|
||||
|
||||
sdmac->last_completed = sdmac->desc.cookie;
|
||||
sdmac->chan.completed_cookie = sdmac->desc.cookie;
|
||||
if (sdmac->desc.callback)
|
||||
sdmac->desc.callback(sdmac->desc.callback_param);
|
||||
}
|
||||
@@ -1127,7 +1126,7 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan,
|
||||
|
||||
last_used = chan->cookie;
|
||||
|
||||
dma_set_tx_state(txstate, sdmac->last_completed, last_used,
|
||||
dma_set_tx_state(txstate, chan->completed_cookie, last_used,
|
||||
sdmac->chn_count - sdmac->chn_real_count);
|
||||
|
||||
return sdmac->status;
|
||||
|
||||
@@ -288,7 +288,7 @@ static void midc_descriptor_complete(struct intel_mid_dma_chan *midc,
|
||||
struct intel_mid_dma_lli *llitem;
|
||||
void *param_txd = NULL;
|
||||
|
||||
midc->completed = txd->cookie;
|
||||
midc->chan.completed_cookie = txd->cookie;
|
||||
callback_txd = txd->callback;
|
||||
param_txd = txd->callback_param;
|
||||
|
||||
@@ -482,12 +482,11 @@ static enum dma_status intel_mid_dma_tx_status(struct dma_chan *chan,
|
||||
dma_cookie_t cookie,
|
||||
struct dma_tx_state *txstate)
|
||||
{
|
||||
struct intel_mid_dma_chan *midc = to_intel_mid_dma_chan(chan);
|
||||
dma_cookie_t last_used;
|
||||
dma_cookie_t last_complete;
|
||||
int ret;
|
||||
|
||||
last_complete = midc->completed;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
@@ -496,7 +495,7 @@ static enum dma_status intel_mid_dma_tx_status(struct dma_chan *chan,
|
||||
midc_scan_descriptors(to_middma_device(chan->device), midc);
|
||||
spin_unlock_bh(&midc->lock);
|
||||
|
||||
last_complete = midc->completed;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_used = chan->cookie;
|
||||
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
@@ -886,7 +885,7 @@ static int intel_mid_dma_alloc_chan_resources(struct dma_chan *chan)
|
||||
pm_runtime_put(&mid->pdev->dev);
|
||||
return -EIO;
|
||||
}
|
||||
midc->completed = chan->cookie = 1;
|
||||
chan->completed_cookie = chan->cookie = 1;
|
||||
|
||||
spin_lock_bh(&midc->lock);
|
||||
while (midc->descs_allocated < DESCS_PER_CHANNEL) {
|
||||
|
||||
@@ -165,7 +165,6 @@ union intel_mid_dma_cfg_hi {
|
||||
* @dma_base: MMIO register space DMA engine base pointer
|
||||
* @ch_id: DMA channel id
|
||||
* @lock: channel spinlock
|
||||
* @completed: DMA cookie
|
||||
* @active_list: current active descriptors
|
||||
* @queue: current queued up descriptors
|
||||
* @free_list: current free descriptors
|
||||
@@ -183,7 +182,6 @@ struct intel_mid_dma_chan {
|
||||
void __iomem *dma_base;
|
||||
int ch_id;
|
||||
spinlock_t lock;
|
||||
dma_cookie_t completed;
|
||||
struct list_head active_list;
|
||||
struct list_head queue;
|
||||
struct list_head free_list;
|
||||
|
||||
@@ -603,7 +603,7 @@ static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete)
|
||||
*/
|
||||
dump_desc_dbg(ioat, desc);
|
||||
if (tx->cookie) {
|
||||
chan->completed_cookie = tx->cookie;
|
||||
chan->common.completed_cookie = tx->cookie;
|
||||
tx->cookie = 0;
|
||||
ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw);
|
||||
ioat->active -= desc->hw->tx_cnt;
|
||||
|
||||
@@ -90,7 +90,6 @@ struct ioat_chan_common {
|
||||
void __iomem *reg_base;
|
||||
unsigned long last_completion;
|
||||
spinlock_t cleanup_lock;
|
||||
dma_cookie_t completed_cookie;
|
||||
unsigned long state;
|
||||
#define IOAT_COMPLETION_PENDING 0
|
||||
#define IOAT_COMPLETION_ACK 1
|
||||
@@ -153,12 +152,11 @@ static inline enum dma_status
|
||||
ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie,
|
||||
struct dma_tx_state *txstate)
|
||||
{
|
||||
struct ioat_chan_common *chan = to_chan_common(c);
|
||||
dma_cookie_t last_used;
|
||||
dma_cookie_t last_complete;
|
||||
|
||||
last_used = c->cookie;
|
||||
last_complete = chan->completed_cookie;
|
||||
last_complete = c->completed_cookie;
|
||||
|
||||
dma_set_tx_state(txstate, last_complete, last_used, 0);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
|
||||
dump_desc_dbg(ioat, desc);
|
||||
if (tx->cookie) {
|
||||
ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw);
|
||||
chan->completed_cookie = tx->cookie;
|
||||
chan->common.completed_cookie = tx->cookie;
|
||||
tx->cookie = 0;
|
||||
if (tx->callback) {
|
||||
tx->callback(tx->callback_param);
|
||||
|
||||
@@ -277,7 +277,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
|
||||
dump_desc_dbg(ioat, desc);
|
||||
tx = &desc->txd;
|
||||
if (tx->cookie) {
|
||||
chan->completed_cookie = tx->cookie;
|
||||
chan->common.completed_cookie = tx->cookie;
|
||||
ioat3_dma_unmap(ioat, desc, idx + i);
|
||||
tx->cookie = 0;
|
||||
if (tx->callback) {
|
||||
|
||||
@@ -317,7 +317,7 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan)
|
||||
}
|
||||
|
||||
if (cookie > 0) {
|
||||
iop_chan->completed_cookie = cookie;
|
||||
iop_chan->common.completed_cookie = cookie;
|
||||
pr_debug("\tcompleted cookie %d\n", cookie);
|
||||
}
|
||||
}
|
||||
@@ -909,7 +909,7 @@ static enum dma_status iop_adma_status(struct dma_chan *chan,
|
||||
enum dma_status ret;
|
||||
|
||||
last_used = chan->cookie;
|
||||
last_complete = iop_chan->completed_cookie;
|
||||
last_complete = chan->completed_cookie;
|
||||
dma_set_tx_state(txstate, last_complete, last_used, 0);
|
||||
ret = dma_async_is_complete(cookie, last_complete, last_used);
|
||||
if (ret == DMA_SUCCESS)
|
||||
@@ -918,7 +918,7 @@ static enum dma_status iop_adma_status(struct dma_chan *chan,
|
||||
iop_adma_slot_cleanup(iop_chan);
|
||||
|
||||
last_used = chan->cookie;
|
||||
last_complete = iop_chan->completed_cookie;
|
||||
last_complete = chan->completed_cookie;
|
||||
dma_set_tx_state(txstate, last_complete, last_used, 0);
|
||||
|
||||
return dma_async_is_complete(cookie, last_complete, last_used);
|
||||
@@ -1650,7 +1650,7 @@ static void iop_chan_start_null_memcpy(struct iop_adma_chan *iop_chan)
|
||||
/* initialize the completed cookie to be less than
|
||||
* the most recently used cookie
|
||||
*/
|
||||
iop_chan->completed_cookie = cookie - 1;
|
||||
iop_chan->common.completed_cookie = cookie - 1;
|
||||
iop_chan->common.cookie = sw_desc->async_tx.cookie = cookie;
|
||||
|
||||
/* channel should not be busy */
|
||||
@@ -1707,7 +1707,7 @@ static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan)
|
||||
/* initialize the completed cookie to be less than
|
||||
* the most recently used cookie
|
||||
*/
|
||||
iop_chan->completed_cookie = cookie - 1;
|
||||
iop_chan->common.completed_cookie = cookie - 1;
|
||||
iop_chan->common.cookie = sw_desc->async_tx.cookie = cookie;
|
||||
|
||||
/* channel should not be busy */
|
||||
|
||||
@@ -1295,7 +1295,7 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id)
|
||||
/* Flip the active buffer - even if update above failed */
|
||||
ichan->active_buffer = !ichan->active_buffer;
|
||||
if (done)
|
||||
ichan->completed = desc->txd.cookie;
|
||||
ichan->dma_chan.completed_cookie = desc->txd.cookie;
|
||||
|
||||
callback = desc->txd.callback;
|
||||
callback_param = desc->txd.callback_param;
|
||||
@@ -1511,7 +1511,7 @@ static int idmac_alloc_chan_resources(struct dma_chan *chan)
|
||||
WARN_ON(ichan->status != IPU_CHANNEL_FREE);
|
||||
|
||||
chan->cookie = 1;
|
||||
ichan->completed = -ENXIO;
|
||||
chan->completed_cookie = -ENXIO;
|
||||
|
||||
ret = ipu_irq_map(chan->chan_id);
|
||||
if (ret < 0)
|
||||
@@ -1600,9 +1600,7 @@ static void idmac_free_chan_resources(struct dma_chan *chan)
|
||||
static enum dma_status idmac_tx_status(struct dma_chan *chan,
|
||||
dma_cookie_t cookie, struct dma_tx_state *txstate)
|
||||
{
|
||||
struct idmac_channel *ichan = to_idmac_chan(chan);
|
||||
|
||||
dma_set_tx_state(txstate, ichan->completed, chan->cookie, 0);
|
||||
dma_set_tx_state(txstate, chan->completed_cookie, chan->cookie, 0);
|
||||
if (cookie != chan->cookie)
|
||||
return DMA_ERROR;
|
||||
return DMA_SUCCESS;
|
||||
@@ -1638,11 +1636,11 @@ static int __init ipu_idmac_init(struct ipu *ipu)
|
||||
|
||||
ichan->status = IPU_CHANNEL_FREE;
|
||||
ichan->sec_chan_en = false;
|
||||
ichan->completed = -ENXIO;
|
||||
snprintf(ichan->eof_name, sizeof(ichan->eof_name), "IDMAC EOF %d", i);
|
||||
|
||||
dma_chan->device = &idmac->dma;
|
||||
dma_chan->cookie = 1;
|
||||
dma_chan->completed_cookie = -ENXIO;
|
||||
dma_chan->chan_id = i;
|
||||
list_add_tail(&dma_chan->device_node, &dma->channels);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user