dmaengine: sprd: add dma mask interface in probe
Subsystems (2)
PATCH v2 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.
-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,"dma_set_mask_and_coherent failed\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
Review
Quoted 10 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]>---
Change in V2:(quoted diff) +0
-2-Change subject line. -Modify error message to make it more readable.
Have you modified the error message against v1? I did not see it.
Quoted 24 lines
--- 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,"dma_set_mask_and_coherent failed\n" ); +return ret; + } + } +/* Parse new and deprecated dma-channels properties */ ret =device_property_read_u32 (&pdev->dev,"dma-channels" , &chn_count);if (ret)
Hi Baolin, I am sorry that didn't add and commit my changes in PATCH V2. I have added the changes in PATCH V3, please check the new email, thank you.
Quoted 43 lines · Baolin Wang
Review
Quoted 10 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]>---
Change in V2:(quoted diff) +0
-2-Change subject line. -Modify error message to make it more readable.Have you modified the error message against v1? I did not see it.
Quoted 24 lines
--- 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,"dma_set_mask_and_coherent failed\n" ); +return ret; + } + } +/* Parse new and deprecated dma-channels properties */ ret =device_property_read_u32 (&pdev->dev,"dma-channels" , &chn_count);if (ret)