fpga: dfl: afu: Pass the correct device to dma_mapping_error()
Subsystems (2)
PATCH 1/1 fpga: dfl: afu: Pass the correct device to dma_mapping_error()
dma_mapping_error() was being called on a different device struct than what was passed to map/unmap. Besides rendering the error checking ineffective, it caused a debug splat with CONFIG_DMA_API_DEBUG.
--- drivers/fpga/dfl-afu-dma-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl-afu-dma-region.c +1 -1
@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0 ],0 , region->length, DMA_BIDIRECTIONAL); -if (dma_mapping_error (&pdata->dev->dev, region->iova)) { +if (dma_mapping_error (dfl_fpga_pdata_to_parent (pdata), region->iova)) {dev_err (&pdata->dev->dev,"failed to map for dma\n" ); ret = -EFAULT ; goto unpin_pages;
Signature · 1 line
1.8.3.1
Quoted 5 lines · Scott Wood
dma_mapping_error()was being called on a different device struct than what was passed to map/unmap. Besides rendering the error checking ineffective, it caused a debug splat withCONFIG_DMA_API_DEBUG.Signed-off-by Scott Wood <[email protected]>
Hi Scott,
Looks good to me. Thanks for catching this issue.
Hao
Quoted 19 lines
--- drivers/fpga/dfl-afu-dma-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/dfl-afu-dma-region.c +1
-1@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0 ],0 , region->length, DMA_BIDIRECTIONAL); -if (dma_mapping_error (&pdata->dev->dev, region->iova)) { +if (dma_mapping_error (dfl_fpga_pdata_to_parent (pdata), region->iova)) {dev_err (&pdata->dev->dev,"failed to map for dma\n" ); ret = -EFAULT ; goto unpin_pages;Signature · 1 line
1.8.3.1
Moritz Fischer
Acked-byHi Scott,
good catch!
Quoted 20 lines · Wu Hao
Quoted 5 lines · Scott Wood
dma_mapping_error()was being called on a different device struct than what was passed to map/unmap. Besides rendering the error checking ineffective, it caused a debug splat withCONFIG_DMA_API_DEBUG.Signed-off-by Scott Wood <[email protected]>Hi Scott,
Looks good to me. Thanks for catching this issue.
Acked-by Wu Hao <[email protected]>Hao
Quoted 4 lines
--- drivers/fpga/dfl-afu-dma-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 14 lines
drivers/fpga/dfl-afu-dma-region.c +1
-2@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0 ],0 , region->length, DMA_BIDIRECTIONAL); -if (dma_mapping_error (&pdata->dev->dev, region->iova)) { +if (dma_mapping_error (dfl_fpga_pdata_to_parent (pdata), region->iova)) {dev_err (&pdata->dev->dev,"failed to map for dma\n" ); ret = -EFAULT ; goto unpin_pages; --Quoted 1 line
1.8.3.1
Thanks
Moritz
Alan Tull
Acked-byOn Thu, Apr 11, 2019 at 11:36 AM Moritz Fischer
<[email protected]> wrote:
Hi Scott,
Thanks!
Quoted 35 lines
Hi Scott,
good catch!
Quoted 29 lines · Wu Hao
Quoted 5 lines · Scott Wood
dma_mapping_error()was being called on a different device struct than what was passed to map/unmap. Besides rendering the error checking ineffective, it caused a debug splat withCONFIG_DMA_API_DEBUG.Signed-off-by Scott Wood <[email protected]>Hi Scott,
Looks good to me. Thanks for catching this issue.
Acked-by Wu Hao <[email protected]>Hao
Quoted 13 lines
--- drivers/fpga/dfl-afu-dma-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/dfl-afu-dma-region.c +0
-1@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0 ],0 , region->length, DMA_BIDIRECTIONAL); -if (dma_mapping_error (&pdata->dev->dev, region->iova)) {
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
drivers/fpga/dfl-afu-dma-region.c +1
-1+if (dma_mapping_error (dfl_fpga_pdata_to_parent (pdata), region->iova)) {dev_err (&pdata->dev->dev,"failed to map for dma\n" ); ret = -EFAULT ; goto unpin_pages; --1.8.3.1
Acked-by Moritz Fischer <[email protected]>
Quoted 3 lines
Thanks
Moritz
Alan
Quoted 51 lines · Alan Tull
On Thu, Apr 11, 2019 at 11:36 AM Moritz Fischer
<[email protected]> wrote:Hi Scott,
Thanks!
Quoted 44 lines
Hi Scott,
good catch!
Quoted 38 lines · Wu Hao
Quoted 6 lines · Scott Wood
dma_mapping_error()was being called on a different device struct than
what was passed to map/unmap. Besides rendering the error checking ineffective, it caused a debug splat withCONFIG_DMA_API_DEBUG.Signed-off-by Scott Wood <[email protected]>Hi Scott,
Looks good to me. Thanks for catching this issue.
Acked-by Wu Hao <[email protected]>Hao
Quoted 22 lines
--- drivers/fpga/dfl-afu-dma-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/dfl- renamed from drivers/fpga/dfl-afu-dma-region.c +0
-0
afu-dma-region.c
indexe18a786fc943..cd68002ac097100644drivers/fpga/dfl-afu-dma-region.c +1
-1@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0 ],0 , region->length, DMA_BIDIRECTIONAL); -if (dma_mapping_error (&pdata->dev->dev, region->iova)) { +if (dma_mapping_error (dfl_fpga_pdata_to_parent (pdata), region- >iova)) {dev_err (&pdata->dev->dev,"failed to map for dma\n" );ret = -EFAULT; goto unpin_pages;--
1.8.3.1
Quoted 3 lines
Quoted 1 line
Acked-by Moritz Fischer <[email protected]>Acked-by Alan Tull <[email protected]>
Whose tree would these patches be going through?
-Scott
Moritz Fischer
maintainerHi Scott,
Quoted 52 lines · Scott Wood
Quoted 51 lines · Alan Tull
On Thu, Apr 11, 2019 at 11:36 AM Moritz Fischer
<[email protected]> wrote:Hi Scott,
Thanks!
Quoted 44 lines
Hi Scott,
good catch!
Quoted 38 lines · Wu Hao
Quoted 6 lines · Scott Wood
dma_mapping_error()was being called on a different device struct than
what was passed to map/unmap. Besides rendering the error checking ineffective, it caused a debug splat withCONFIG_DMA_API_DEBUG.Signed-off-by Scott Wood <[email protected]>Hi Scott,
Looks good to me. Thanks for catching this issue.
Acked-by Wu Hao <[email protected]>Hao
Quoted 22 lines
--- drivers/fpga/dfl-afu-dma-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/dfl- renamed from drivers/fpga/dfl-afu-dma-region.c +0
-0
afu-dma-region.c
indexe18a786fc943..cd68002ac097100644drivers/fpga/dfl-afu-dma-region.c +1
-1@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata, region->pages[0 ],0 , region->length, DMA_BIDIRECTIONAL); -if (dma_mapping_error (&pdata->dev->dev, region->iova)) { +if (dma_mapping_error (dfl_fpga_pdata_to_parent (pdata), region- >iova)) {dev_err (&pdata->dev->dev,"failed to map for dma\n" );ret = -EFAULT; goto unpin_pages;--
1.8.3.1
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Acked-by Moritz Fischer <[email protected]>Acked-by Alan Tull <[email protected]>Whose tree would these patches be going through?
Greg, usually. We're a bit late this time... again ... But haven't forgotten about it.
Sorry,
Moritz