Skip to content

Commit b786129

Browse files
Prike Liangalexdeucher
authored andcommitted
drm/amdgpu: Fix dummy_read_page overlapping mappings
Use the dma_map_page_attrs() with DMA_ATTR_SKIP_CPU_SYNC attribute setting to handle the dummy page overlapping mappings. Signed-off-by: Prike Liang <[email protected]> Suggested-by: Christian König <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent afe260d commit b786129

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ static int amdgpu_gart_dummy_page_init(struct amdgpu_device *adev)
7878

7979
if (adev->dummy_page_addr)
8080
return 0;
81-
adev->dummy_page_addr = dma_map_page(&adev->pdev->dev, dummy_page, 0,
82-
PAGE_SIZE, DMA_BIDIRECTIONAL);
81+
adev->dummy_page_addr = dma_map_page_attrs(&adev->pdev->dev, dummy_page, 0,
82+
PAGE_SIZE, DMA_BIDIRECTIONAL,
83+
DMA_ATTR_SKIP_CPU_SYNC);
8384
if (dma_mapping_error(&adev->pdev->dev, adev->dummy_page_addr)) {
8485
dev_err(&adev->pdev->dev, "Failed to DMA MAP the dummy page\n");
8586
adev->dummy_page_addr = 0;
@@ -99,8 +100,9 @@ void amdgpu_gart_dummy_page_fini(struct amdgpu_device *adev)
99100
{
100101
if (!adev->dummy_page_addr)
101102
return;
102-
dma_unmap_page(&adev->pdev->dev, adev->dummy_page_addr, PAGE_SIZE,
103-
DMA_BIDIRECTIONAL);
103+
dma_unmap_page_attrs(&adev->pdev->dev, adev->dummy_page_addr, PAGE_SIZE,
104+
DMA_BIDIRECTIONAL,
105+
DMA_ATTR_SKIP_CPU_SYNC);
104106
adev->dummy_page_addr = 0;
105107
}
106108

0 commit comments

Comments
 (0)