summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Scott <mike@foundries.io>2021-05-01 04:06:40 +0300
committerEmil Renner Berthing <kernel@esmil.dk>2021-09-27 03:08:15 +0300
commit5fe4c46ebb65c88e3c25c2e27579be996284c796 (patch)
tree3fccd9912e7c8fc2a93f5c835c415dc96c6d9537
parent7125bbd2ecd4d2bde5c15dbcd23512d6db85c7b5 (diff)
downloadlinux-5fe4c46ebb65c88e3c25c2e27579be996284c796.tar.xz
drivers/dma: Fix VIC7100 dw-axi-dmac-platform driver addition
Descriptor management was simplified with commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef6fb2d6f1abd56cc067c694253ea362159b5ac3 Code added to dw-axi-dmac-platform driver due to VIC7100 Cache Coherency issues needed follow those changes. Signed-off-by: Michael Scott <mike@foundries.io>
-rw-r--r--drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 813824c41a03..a64a45110dd6 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -356,7 +356,6 @@ static void dw_axi_dma_set_byte_halfword(struct axi_dma_chan *chan, bool set)
static void axi_chan_block_xfer_start(struct axi_dma_chan *chan,
struct axi_dma_desc *first)
{
- struct axi_dma_desc *desc;
u32 priority = chan->chip->dw->hdata->priority[chan->id];
u32 reg, irq_mask;
u8 lms = 0; /* Select AXI0 master for LLI fetching */
@@ -410,19 +409,23 @@ static void axi_chan_block_xfer_start(struct axi_dma_chan *chan,
irq_mask |= DWAXIDMAC_IRQ_SUSPENDED;
axi_chan_irq_set(chan, irq_mask);
- /*flush all the desc */
+ /* flush all the desc */
#ifdef CONFIG_SOC_STARFIVE_VIC7100
if(chan->chip->flag->need_flush) {
- /*flush fisrt desc*/
- starfive_flush_dcache(first->vd.tx.phys, sizeof(*first));
+ int count = atomic_read(&chan->descs_allocated);
+ int i;
- list_for_each_entry(desc, &first->xfer_list, xfer_list) {
- starfive_flush_dcache(desc->vd.tx.phys, sizeof(*desc));
+ for (i = 0; i < count; i++) {
+ starfive_flush_dcache(first->hw_desc[i].llp,
+ sizeof(*first->hw_desc[i].lli));
dev_dbg(chan->chip->dev,
"sar:%#llx dar:%#llx llp:%#llx ctl:0x%x:%08x\n",
- desc->lli.sar, desc->lli.dar, desc->lli.llp,
- desc->lli.ctl_hi, desc->lli.ctl_lo);
+ first->hw_desc[i].lli->sar,
+ first->hw_desc[i].lli->dar,
+ first->hw_desc[i].lli->llp,
+ first->hw_desc[i].lli->ctl_hi,
+ first->hw_desc[i].lli->ctl_lo);
}
}
#endif