Skip to content

Commit bb7c772

Browse files
committed
dw-dma: remove invalidation and write back for lli
The lli structs are already allocated them from the coherent heap buffer so no need invalidation and write back anymore. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
1 parent 95f33b5 commit bb7c772

File tree

2 files changed

+3
-20
lines changed
  • src

2 files changed

+3
-20
lines changed

src/drivers/dw/dma.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,6 @@ static int dw_dma_stop(struct dma_chan_data *channel)
437437
lli->ctrl_hi &= ~DW_CTLH_DONE(1);
438438
lli++;
439439
}
440-
441-
dcache_writeback_region(dw_chan->lli,
442-
sizeof(struct dw_lli) * channel->desc_count);
443440
#endif
444441

445442
/* disable linear link position */
@@ -767,10 +764,6 @@ static int dw_dma_set_config(struct dma_chan_data *channel,
767764
#endif
768765
}
769766

770-
/* write back descriptors so DMA engine can read them directly */
771-
dcache_writeback_region(dw_chan->lli,
772-
sizeof(struct dw_lli) * channel->desc_count);
773-
774767
channel->status = COMP_STATE_PREPARE;
775768
dw_chan->lli_current = dw_chan->lli;
776769

@@ -810,8 +803,9 @@ static void dw_dma_verify_transfer(struct dma_chan_data *channel,
810803
#if defined __ZEPHYR__
811804
int i;
812805
#else
813-
struct dw_lli *lli = platform_dw_dma_lli_get(dw_chan->lli_current);
806+
struct dw_lli *lli = dw_chan->lli_current;
814807
#endif
808+
815809
switch (next->status) {
816810
case DMA_CB_STATUS_END:
817811
channel->status = COMP_STATE_PREPARE;
@@ -823,20 +817,14 @@ static void dw_dma_verify_transfer(struct dma_chan_data *channel,
823817
* sure the cache is coherent between DSP and DMAC.
824818
*/
825819
#if defined __ZEPHYR__
826-
dcache_invalidate_region(dw_chan->lli,
827-
sizeof(struct dw_lli) * channel->desc_count);
828-
829820
for (i = 0; i < channel->desc_count; i++)
830821
dw_chan->lli[i].ctrl_hi &= ~DW_CTLH_DONE(1);
831-
832-
dcache_writeback_region(dw_chan->lli,
833-
sizeof(struct dw_lli) * channel->desc_count);
834822
#else
835823
while (lli->ctrl_hi & DW_CTLH_DONE(1)) {
836824
lli->ctrl_hi &= ~DW_CTLH_DONE(1);
837825
dw_chan->lli_current =
838826
(struct dw_lli *)dw_chan->lli_current->llp;
839-
lli = platform_dw_dma_lli_get(dw_chan->lli_current);
827+
lli = dw_chan->lli_current;
840828
}
841829
#endif
842830
break;

src/platform/intel/cavs/include/cavs/drivers/dw-dma.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ static inline void platform_dw_dma_llp_disable(struct dma *dma,
8585
shim_read(DW_CHLLPC(dma, chan)) & ~SHIM_GPDMA_CHLLPC_EN);
8686
}
8787

88-
static inline struct dw_lli *platform_dw_dma_lli_get(struct dw_lli *lli)
89-
{
90-
return cache_to_uncache(lli);
91-
}
92-
9388
#endif /* __CAVS_LIB_DW_DMA_H__ */
9489

9590
#else

0 commit comments

Comments
 (0)