From 572d5edff4129c6bcb81ddaafa305b2dd36798ad Mon Sep 17 00:00:00 2001 From: Harshdeep Dhatt Date: Tue, 8 Oct 2019 15:24:57 -0700 Subject: [PATCH] msm: kgsl: Set DMA Mask for gmu device A single page buffer allocated via dma_alloc_attrs comes from the system memory instead of contiguous space now. That page can have address larger than the default dma mask of 32 bits. Change-Id: I591f09362d67b2a80e335ba3e593bd5e4e2f08ea Signed-off-by: Harshdeep Dhatt --- drivers/gpu/msm/kgsl_gmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/msm/kgsl_gmu.c b/drivers/gpu/msm/kgsl_gmu.c index 6db4433fd584..edf880a1c237 100644 --- a/drivers/gpu/msm/kgsl_gmu.c +++ b/drivers/gpu/msm/kgsl_gmu.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. */ #include @@ -1308,6 +1308,10 @@ static int gmu_probe(struct kgsl_device *device, struct device_node *node) of_dma_configure(&gmu->pdev->dev, node, true); + dma_set_coherent_mask(&gmu->pdev->dev, DMA_BIT_MASK(64)); + gmu->pdev->dev.dma_mask = &gmu->pdev->dev.coherent_dma_mask; + set_dma_ops(&gmu->pdev->dev, NULL); + /* Set up GMU regulators */ ret = gmu_regulators_probe(gmu, node); if (ret)