Skip to content

Commit

Permalink
dmaengine: sprd: add dma mask interface in probe
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Baolin Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
Kaiwei Liu authored and vinodkoul committed Oct 2, 2023
1 parent a04bbea commit 9c6e02e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/dma/sprd-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9c6e02e

Please sign in to comment.