Skip to content

Commit

Permalink
nvdla: Drop cache flushing code
Browse files Browse the repository at this point in the history
This shouldn't be needed with Atish' non-coherent dma solution.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
  • Loading branch information
esmil committed Jun 24, 2021
1 parent 18f0e8a commit 9b0eb4e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 31 deletions.
9 changes: 0 additions & 9 deletions drivers/nvdla/bdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ processor_bdma_program_slot(struct dla_bdma_surface_desc *bdma_surface,
uint64_t destination_addr = 0;
uint32_t high, low, reg;
uint8_t bdma_free_slots = 0;
uint64_t bdma_len = 0;
struct dla_engine *engine = dla_get_engine();

dla_debug("Enter: %s\n", __func__);
Expand Down Expand Up @@ -197,14 +196,6 @@ processor_bdma_program_slot(struct dla_bdma_surface_desc *bdma_surface,
bdma_reg_write(CFG_DST_SURF, transfer->destination_surface);
bdma_reg_write(CFG_OP, FIELD_ENUM(BDMA_CFG_OP_0, EN, ENABLE));

#ifdef CONFIG_NVDLA_NEED_FLUSH
bdma_len = (transfer->surface_repeat) * (transfer->source_surface); //???
nvdla_flush_dcache((unsigned long)source_addr,bdma_len);
nvdla_flush_dcache((unsigned long)destination_addr,bdma_len);
dla_info("%s():surface_repeat:%#x,source_surface:%#x bdmalen:%#llx\n",__func__,transfer->surface_repeat,transfer->source_surface,bdma_len);
dla_info("%s():dma_src_addr:%#llx,dma_dst_addr:%#llx \n",__func__,source_addr,destination_addr);
#endif

dla_debug("Exit: %s\n", __func__);

exit:
Expand Down
3 changes: 0 additions & 3 deletions drivers/nvdla/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ dla_get_op_desc(struct dla_task *task, int16_t index,
}

exit:
if (desc) {
nvdla_flush_dcache(dw_virt_to_phys((void *)desc), sizeof(*desc));
}
return desc;
}

Expand Down
8 changes: 0 additions & 8 deletions drivers/nvdla/include/opendla.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,11 @@
#define __OPENDLA_H_

#define DLA_2_CONFIG
#define CONFIG_NVDLA_NEED_FLUSH

#ifdef DLA_2_CONFIG
#include <opendla_small.h>
#else
#include <opendla_initial.h>
#endif

#ifdef CONFIG_NVDLA_NEED_FLUSH
#include <soc/starfive/vic7100.h>
#define nvdla_flush_dcache starfive_flush_dcache
#else
#define nvdla_flush_dcache
#endif

#endif
8 changes: 0 additions & 8 deletions drivers/nvdla/nvdla_core_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void dla_error(const char *str, ...)
void *dla_memset(void *src, int ch, uint64_t len)
{
memset(src, ch, len);
nvdla_flush_dcache(dw_virt_to_phys(src),len);
return src;
}

Expand Down Expand Up @@ -255,11 +254,7 @@ int32_t dla_data_write(void *driver_context, void *task_data,
goto end_cpu_access;
}


nvdla_flush_dcache(dw_virt_to_phys(src),size);
memcpy((void *)((uint8_t *)ptr + offset), src, size);
nvdla_flush_dcache(dma_addr+offset,size);

dma_buf_vunmap(buf, &map);

end_cpu_access:
Expand Down Expand Up @@ -306,10 +301,7 @@ int32_t dla_data_read(void *driver_context, void *task_data,
goto end_cpu_access;
}

nvdla_flush_dcache(dma_addr+offset,size);
memcpy(dst, (void *)(((uint8_t *)ptr) + offset), size);
nvdla_flush_dcache(dw_virt_to_phys(dst),size);

dma_buf_vunmap(buf, &map);

end_cpu_access:
Expand Down
2 changes: 0 additions & 2 deletions drivers/nvdla/nvdla_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ static int32_t nvdla_fill_task_desc(struct nvdla_ioctl_submit_task *local_task,
}

task->address_list = handles;

nvdla_flush_dcache(dw_virt_to_phys((void *)(task)),sizeof(*task));
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/nvdla/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,6 @@ dla_execute_task(void *engine_context, void *task_data, void *config_data)
if (ret)
goto complete;

nvdla_flush_dcache(dw_virt_to_phys((void *)engine), sizeof(*engine));
dla_debug_address_info(engine->task);

/**
Expand Down

0 comments on commit 9b0eb4e

Please sign in to comment.