summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorKaiwei Liu <kaiwei.liu@unisoc.com>2023-09-19 15:38:01 +0800
committerVinod Koul <vkoul@kernel.org>2023-10-02 21:28:33 +0530
commit9c6e02eab10a8a7628cac2cd9b8db6806acc63ca (patch)
tree6fb200a88b46c2d228ae0af60c78d636ace18fe8 /drivers/dma
parenta04bbeaa37d8789de5592506fa776256e784b69c (diff)
dmaengine: sprd: add dma mask interface in probe
In the probe of DMA, the default addressing range is 32 bits, while the actual DMA hardware addressing range used is 36 bits. So add dma_set_mask_and_coherent function to match DMA addressing range. Signed-off-by: Kaiwei Liu <kaiwei.liu@unisoc.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Link: https://lore.kernel.org/r/20230919073801.25054-1-kaiwei.liu@unisoc.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/sprd-dma.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 0064a5f4f0cb..fe3d69c1ce1f 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1117,6 +1117,15 @@ static int sprd_dma_probe(struct platform_device *pdev)
u32 chn_count;
int ret, i;
+ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36));
+ if (ret) {
+ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+ if (ret) {
+ dev_err(&pdev->dev, "unable to set coherent mask to 32\n");
+ return ret;
+ }
+ }
+
/* Parse new and deprecated dma-channels properties */
ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count);
if (ret)