Skip to content

Commit

Permalink
drm/amdkfd: replace err by dbg print at svm vram migration
Browse files Browse the repository at this point in the history
Avoid spam the kernel log on application memory allocation failures.
__func__ argument was also removed from dev_fmt macro due to
parameter conflicts with dynamic_dev_dbg.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.comi>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Alex Sierra authored and Alex Deucher committed Feb 11, 2022
1 parent 24992ab commit 7f161df
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#ifdef dev_fmt
#undef dev_fmt
#endif
#define dev_fmt(fmt) "kfd_migrate: %s: " fmt, __func__
#define dev_fmt(fmt) "kfd_migrate: " fmt

static uint64_t
svm_migrate_direct_mapping_addr(struct amdgpu_device *adev, uint64_t addr)
Expand Down Expand Up @@ -312,7 +312,7 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,

r = svm_range_vram_node_new(adev, prange, true);
if (r) {
dev_err(adev->dev, "fail %d to alloc vram\n", r);
dev_dbg(adev->dev, "fail %d to alloc vram\n", r);
goto out;
}

Expand All @@ -331,7 +331,8 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
DMA_TO_DEVICE);
r = dma_mapping_error(dev, src[i]);
if (r) {
dev_err(adev->dev, "fail %d dma_map_page\n", r);
dev_err(adev->dev, "%s: fail %d dma_map_page\n",
__func__, r);
goto out_free_vram_pages;
}
} else {
Expand Down Expand Up @@ -432,8 +433,8 @@ svm_migrate_vma_to_vram(struct amdgpu_device *adev, struct svm_range *prange,

r = migrate_vma_setup(&migrate);
if (r) {
dev_err(adev->dev, "vma setup fail %d range [0x%lx 0x%lx]\n", r,
prange->start, prange->last);
dev_err(adev->dev, "%s: vma setup fail %d range [0x%lx 0x%lx]\n",
__func__, r, prange->start, prange->last);
goto out_free;
}

Expand Down Expand Up @@ -611,7 +612,7 @@ svm_migrate_copy_to_ram(struct amdgpu_device *adev, struct svm_range *prange,
dst[i] = dma_map_page(dev, dpage, 0, PAGE_SIZE, DMA_FROM_DEVICE);
r = dma_mapping_error(dev, dst[i]);
if (r) {
dev_err(adev->dev, "fail %d dma_map_page\n", r);
dev_err(adev->dev, "%s: fail %d dma_map_page\n", __func__, r);
goto out_oom;
}

Expand Down Expand Up @@ -671,8 +672,8 @@ svm_migrate_vma_to_ram(struct amdgpu_device *adev, struct svm_range *prange,

r = migrate_vma_setup(&migrate);
if (r) {
dev_err(adev->dev, "vma setup fail %d range [0x%lx 0x%lx]\n", r,
prange->start, prange->last);
dev_err(adev->dev, "%s: vma setup fail %d range [0x%lx 0x%lx]\n",
__func__, r, prange->start, prange->last);
goto out_free;
}

Expand Down

0 comments on commit 7f161df

Please sign in to comment.