From 71733cb184b5f88c5427520aa0c1f6f14d2f975d Mon Sep 17 00:00:00 2001 From: c_mtharu Date: Fri, 9 Jun 2017 14:53:48 +0530 Subject: [PATCH] sdm660: adsprpc: Map uncached buffers as non-coherent Map un-cached buffers as non io-coherent to avoid snooping overhead. Change-Id: Iddbde76d6d8a13cd48c737f1046a53a2bc1ef2a5 Acked-by: Viswanatham Paduchuri Signed-off-by: Tharun Kumar Merugu --- drivers/char/adsprpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 14c833691194..9c4d2d092ee4 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -670,7 +670,8 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, unsigned attr, init_dma_attrs(&attrs); dma_set_attr(DMA_ATTR_EXEC_MAPPING, &attrs); - if (map->attr & FASTRPC_ATTR_NON_COHERENT) + if ((map->attr & FASTRPC_ATTR_NON_COHERENT) || + (sess->smmu.coherent && map->uncached)) dma_set_attr(DMA_ATTR_FORCE_NON_COHERENT, &attrs); else if (map->attr & FASTRPC_ATTR_COHERENT)