Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b686ad48 authored by Mohammed Nayeem Ur Rahman's avatar Mohammed Nayeem Ur Rahman
Browse files

msm: adsprpc: Flush and invalidate unaligned buffers



If the buffer being shared with QDSP is not cache aligned,
perform both flush and invalidate.

Change-Id: Iccb619bd5efdf5b0710e2aaf4c4561f540dac8e1
Acked-by: default avatarVishnu Karthik D <vikarthi@qti.qualcomm.com>
Signed-off-by: default avatarMohammed Nayeem Ur Rahman <mohara@codeaurora.org>
parent 3f48f6b2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1753,9 +1753,9 @@ static void inv_args_pre(struct smq_invoke_ctx *ctx)
				uint64_to_ptr(rpra[i].buf.pv))) {
			if (map && map->buf) {
				dma_buf_begin_cpu_access(map->buf,
					DMA_TO_DEVICE);
					DMA_BIDIRECTIONAL);
				dma_buf_end_cpu_access(map->buf,
					DMA_TO_DEVICE);
					DMA_BIDIRECTIONAL);
			} else
				dmac_flush_range(
					uint64_to_ptr(rpra[i].buf.pv), (char *)
@@ -1767,9 +1767,9 @@ static void inv_args_pre(struct smq_invoke_ctx *ctx)
		if (!IS_CACHE_ALIGNED(end)) {
			if (map && map->buf) {
				dma_buf_begin_cpu_access(map->buf,
					DMA_TO_DEVICE);
					DMA_BIDIRECTIONAL);
				dma_buf_end_cpu_access(map->buf,
					DMA_TO_DEVICE);
					DMA_BIDIRECTIONAL);
			} else
				dmac_flush_range((char *)end,
					(char *)end + 1);