qcacmn: Use cache_inv instead of cache_sync

Use cache invalidate api instead of cache_sync since
cache_sync api is not available in MIPS platform.

Change-Id: I4b8e2fc3cb9055d1c392c2f6dbe7d6be7c66031b
This commit is contained in:
Nandha Kishore Easwaran
2020-11-24 15:06:12 +05:30
committed by snandini
parent ee46808595
commit 1d68998d30

View File

@@ -1197,6 +1197,31 @@ void *hal_srng_dst_peek(hal_soc_handle_t hal_soc_hdl,
return NULL;
}
/**
* hal_mem_dma_cache_sync - Cache sync the specified virtual address Range
* @hal_soc: HAL soc handle
* @desc: desc start address
* @entry_size: size of memory to sync
*
* Return: void
*/
#if defined(__LINUX_MIPS32_ARCH__) || defined(__LINUX_MIPS64_ARCH__)
static inline void hal_mem_dma_cache_sync(struct hal_soc *soc, uint32_t *desc,
uint32_t entry_size)
{
qdf_nbuf_dma_inv_range((void *)desc, (void *)(desc + entry_size));
}
#else
static inline void hal_mem_dma_cache_sync(struct hal_soc *soc, uint32_t *desc,
uint32_t entry_size)
{
qdf_mem_dma_cache_sync(soc->qdf_dev, qdf_mem_virt_to_phys(desc),
QDF_DMA_FROM_DEVICE,
(entry_size * sizeof(uint32_t)));
}
#endif
/**
* hal_srng_access_start_unlocked - Start ring access (unlocked). Should use
* hal_srng_access_start if locked access is required
@@ -1224,12 +1249,8 @@ hal_srng_access_start_unlocked(hal_soc_handle_t hal_soc_hdl,
if (srng->flags & HAL_SRNG_CACHED_DESC) {
desc = hal_srng_dst_peek(hal_soc_hdl, hal_ring_hdl);
if (qdf_likely(desc)) {
qdf_mem_dma_cache_sync(soc->qdf_dev,
qdf_mem_virt_to_phys
(desc),
QDF_DMA_FROM_DEVICE,
(srng->entry_size *
sizeof(uint32_t)));
hal_mem_dma_cache_sync(soc, desc,
srng->entry_size);
qdf_prefetch(desc);
}
}
@@ -1320,11 +1341,7 @@ void *hal_srng_dst_get_next(void *hal_soc,
tp = srng->u.dst_ring.tp;
desc_next = &srng->ring_base_vaddr[srng->u.dst_ring.tp];
qdf_mem_dma_cache_sync(soc->qdf_dev,
qdf_mem_virt_to_phys(desc_next),
QDF_DMA_FROM_DEVICE,
(srng->entry_size *
sizeof(uint32_t)));
hal_mem_dma_cache_sync(soc, desc_next, srng->entry_size);
qdf_prefetch(desc_next);
}