summaryrefslogtreecommitdiff
path: root/drivers/dma-buf/heaps
diff options
context:
space:
mode:
authorJason Liu <jason.hui.liu@nxp.com>2022-03-10 17:31:56 +0800
committerJason Liu <jason.hui.liu@nxp.com>2022-03-11 11:41:22 +0800
commitf74fe3b339a96b16c18ed7dba37d7ceedeb462fb (patch)
tree28ba56a9cdb5a40950a4b2a902925835cb3e0ed0 /drivers/dma-buf/heaps
parentc1084c2773fc1005ed140db625399d5334d94a28 (diff)
parentefe3167e52a5833ec20ee6214be9b99b378564a8 (diff)
Merge tag 'v5.15.27' into lf-5.15.y
This is the 5.15.27 stable release * tag 'v5.15.27': (3069 commits) Linux 5.15.27 hamradio: fix macro redefine warning KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() ... Signed-off-by: Jason Liu <jason.hui.liu@nxp.com> Conflicts: arch/arm/boot/dts/imx7ulp.dtsi arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts arch/arm64/boot/dts/freescale/imx8mq.dtsi drivers/dma-buf/heaps/cma_heap.c drivers/gpu/drm/bridge/synopsys/dw-hdmi.c drivers/gpu/drm/mxsfb/mxsfb_kms.c drivers/mmc/host/sdhci-esdhc-imx.c drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c drivers/rpmsg/rpmsg_char.c drivers/soc/imx/gpcv2.c drivers/thermal/imx_thermal.c
Diffstat (limited to 'drivers/dma-buf/heaps')
-rw-r--r--drivers/dma-buf/heaps/cma_heap.c6
-rw-r--r--drivers/dma-buf/heaps/system_heap.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index de4d10b30339..8a19859d3c7e 100644
--- a/drivers/dma-buf/heaps/cma_heap.c
+++ b/drivers/dma-buf/heaps/cma_heap.c
@@ -135,10 +135,11 @@ static int cma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
struct cma_heap_buffer *buffer = dmabuf->priv;
struct dma_heap_attachment *a;
+ mutex_lock(&buffer->lock);
+
if (buffer->vmap_cnt)
invalidate_kernel_vmap_range(buffer->vaddr, buffer->len);
- mutex_lock(&buffer->lock);
if (!buffer->uncached) {
list_for_each_entry(a, &buffer->attachments, list) {
if (!a->mapped)
@@ -157,10 +158,11 @@ static int cma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
struct cma_heap_buffer *buffer = dmabuf->priv;
struct dma_heap_attachment *a;
+ mutex_lock(&buffer->lock);
+
if (buffer->vmap_cnt)
flush_kernel_vmap_range(buffer->vaddr, buffer->len);
- mutex_lock(&buffer->lock);
if (!buffer->uncached) {
list_for_each_entry(a, &buffer->attachments, list) {
if (!a->mapped)
diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 23a7e74ef966..8660508f3684 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -289,7 +289,7 @@ static void system_heap_dma_buf_release(struct dma_buf *dmabuf)
int i;
table = &buffer->sg_table;
- for_each_sg(table->sgl, sg, table->nents, i) {
+ for_each_sgtable_sg(table, sg, i) {
struct page *page = sg_page(sg);
__free_pages(page, compound_order(page));