struct imx_dma_data data;
unsigned int chn_count;
unsigned int chn_real_count;
+ bool context_loaded;
u32 bd_size_sum;
bool src_dualfifo;
bool dst_dualfifo;
int ret;
unsigned long flags;
+ if (sdmac->context_loaded)
+ return 0;
+
if (sdmac->direction == DMA_DEV_TO_MEM)
load_address = sdmac->pc_from_device;
else if (sdmac->direction == DMA_DEV_TO_DEV)
spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
+ sdmac->context_loaded = true;
+
return ret;
}
spin_unlock_irqrestore(&sdmac->vc.lock, flags);
vchan_dma_desc_free_list(&sdmac->vc, &head);
sdma_disable_channel(chan);
+ sdmac->context_loaded = false;
return 0;
}
if (sdma_alloc_bd(desc))
goto err_desc_out;
+ if (sdma_load_context(sdmac))
+ goto err_desc_out;
+
return desc;
+
err_desc_out:
kfree(desc);
err_out:
struct sdma_channel *sdmac = &sdma->channel[i];
sdmac->sdma = sdma;
+ sdmac->context_loaded = false;
sdmac->channel = i;
sdmac->status = DMA_IN_PROGRESS;
sdmac->vc.desc_free = sdma_desc_free;