From 3132327f46534d85dc8ae92c85b7e9426274746a Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Wed, 22 Jul 2020 15:44:13 -0700 Subject: [PATCH] firmware: qcom_scm: Set DMA coherent mask as well as the streaming mask The driver currently sets up the DMA streaming mask to 64 bits, which helps with being able to map memory above 32 bits with the DMA APIs. However, when allocating coherent memory, the DMA framework will allocate memory, and ensure that the memory is within the device's coherent memory limitations, not the streaming limitations. Since the coherent DMA mask is not set up for the device, it is left at its default value--32 bits--so any allocations that have an address above 32 bits will be deemed as not suitable to satisfy the allocation. There is no limitation for coherent memory access for the SCM device, so align it to the 64 bit streaming DMA mask. Change-Id: I5a8493ec31e06aa6a80e4fab31bce1fc6e13fbf3 Signed-off-by: Isaac J. Manjarres --- drivers/firmware/qcom_scm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 2ac386e03ace..73f4fc71713d 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1090,7 +1090,7 @@ static int qcom_scm_probe(struct platform_device *pdev) __qcom_scm_init(); - ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); if (ret) return ret;