From 668385da4ec5da8a0a027969308635c5c4b14fe3 Mon Sep 17 00:00:00 2001 From: Tharun Kumar Merugu Date: Wed, 27 Nov 2019 15:56:07 +0530 Subject: [PATCH] msm: adsprpc: Add force no flush and invalidate flag Adding force no flush and invalidate flag for rpcmem_alloc and respective attributes for remote_register_buf_attr. Skip flush and invalidate if corresponding flag is set. Change-Id: I5b872d1f22b082716a1fe715375c66a212fedbac Acked-by: Deepika Singh Signed-off-by: Tharun Kumar Merugu --- drivers/char/adsprpc.c | 6 ++++++ drivers/char/adsprpc_shared.h | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 638f2784ef12..509942cbc2da 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -1872,6 +1872,8 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; + if (map && (map->attr & FASTRPC_ATTR_FORCE_NOFLUSH)) + continue; if (rpra && rpra[i].buf.len && ctx->overps[oix]->mstart) { @@ -1974,6 +1976,8 @@ static void inv_args_pre(struct smq_invoke_ctx *ctx) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; + if (map && (map->attr & FASTRPC_ATTR_FORCE_NOINVALIDATE)) + continue; if (buf_page_start(ptr_to_uint64((void *)rpra)) == buf_page_start(rpra[i].buf.pv)) @@ -2021,6 +2025,8 @@ static void inv_args(struct smq_invoke_ctx *ctx) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; + if (map && (map->attr & FASTRPC_ATTR_FORCE_NOINVALIDATE)) + continue; if (buf_page_start(ptr_to_uint64((void *)rpra)) == buf_page_start(rpra[i].buf.pv)) { diff --git a/drivers/char/adsprpc_shared.h b/drivers/char/adsprpc_shared.h index 2469fbead694..985f7bbe807b 100644 --- a/drivers/char/adsprpc_shared.h +++ b/drivers/char/adsprpc_shared.h @@ -46,6 +46,16 @@ /* Fastrpc attribute for no mapping of fd */ #define FASTRPC_ATTR_NOMAP (16) +/* + * Fastrpc attribute to skip flush by fastrpc + */ +#define FASTRPC_ATTR_FORCE_NOFLUSH (32) + +/* + * Fastrpc attribute to skip invalidate by fastrpc + */ +#define FASTRPC_ATTR_FORCE_NOINVALIDATE (64) + /* Driver should operate in parallel with the co-processor */ #define FASTRPC_MODE_PARALLEL 0