dmaengine: sprd: add dma mask interface in probe
Subsystems (2)
PATCH v3 1/1 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.
---
Change in V2:
-Change subject line.
Change in V3:
-Modify error message to make it more readable.
--- drivers/dma/sprd-dma.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/dma/sprd-dma.c +9 -0
@@ -1115,6 +1115,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)
Signature · 1 line
2.17.1
Quoted 6 lines · Kaiwei Liu
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_coherentfunction to match DMA addressing range.Signed-off-by Kaiwei Liu <[email protected]>
LGTM.
Quoted 29 lines
---
Change in V2:
-Change subject line.
Change in V3:(quoted diff) +0
-2-Modify error message to make it more readable. --- drivers/dma/sprd-dma.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/dma/sprd-dma.c +9
-0@@ -1115,6 +1115,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)
Quoted 6 lines · Kaiwei Liu
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_coherentfunction to match DMA addressing range.
Applied, thanks!
[1/1] dmaengine: sprd: add dma mask interface in probe
commit: 47b077c21590490f5bcb8ee80c66ce7a6c201d11
Best regards,
Signature · 1 line
~Vinod