diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2019-03-07 13:12:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-31 16:43:46 +0300 |
commit | 8b29b2bf0a8d5768d3e419634731511ea819f2b5 (patch) | |
tree | 83afe4560c81f8fb113d2b99140c13a85e6f1ee3 /drivers/misc | |
parent | 954edc466128479872731d06f026d0e71840d153 (diff) | |
download | linux-8b29b2bf0a8d5768d3e419634731511ea819f2b5.tar.xz |
misc: fastrpc: make sure memory read and writes are visible
[ Upstream commit 415a0729bd1225f0ffbc0ba82888dd65772554f7 ]
dma_alloc_coherent buffers could have writes queued in store buffers so
commit them before sending buffer to DSP using correct dma barriers.
Same with vice-versa.
Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/fastrpc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 9996c83ba5cb..a10937652ca7 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -790,6 +790,9 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, if (err) goto bail; } + + /* make sure that all CPU memory writes are seen by DSP */ + dma_wmb(); /* Send invoke buffer to remote dsp */ err = fastrpc_invoke_send(fl->sctx, ctx, kernel, handle); if (err) @@ -806,6 +809,8 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, goto bail; if (ctx->nscalars) { + /* make sure that all memory writes by DSP are seen by CPU */ + dma_rmb(); /* populate all the output buffers with results */ err = fastrpc_put_args(ctx, kernel); if (err) |