summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2021-09-17 14:32:14 -0400
committerAlex Deucher <alexander.deucher@amd.com>2021-09-23 16:34:49 -0400
commit586d71a42725dbc67cbb15f9904c65d99a757b0f (patch)
tree9b14e5fe284e6fe0e62bb4b0f63465ad198d82d4 /drivers/gpu
parent640ae42efb828be69a9ee6ac88fb3d5a3e678ddf (diff)
downloadlinux-586d71a42725dbc67cbb15f9904c65d99a757b0f.tar.gz
linux-586d71a42725dbc67cbb15f9904c65d99a757b0f.tar.bz2
linux-586d71a42725dbc67cbb15f9904c65d99a757b0f.zip
drm/amdkfd: handle svm migrate init error
If svm migration init failed to create pgmap for device memory, set pgmap type to 0 to disable device SVM support capability. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_migrate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
index dab290a4d19d..165e0ebb619d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
@@ -894,6 +894,9 @@ int svm_migrate_init(struct amdgpu_device *adev)
r = devm_memremap_pages(adev->dev, pgmap);
if (IS_ERR(r)) {
pr_err("failed to register HMM device memory\n");
+
+ /* Disable SVM support capability */
+ pgmap->type = 0;
devm_release_mem_region(adev->dev, res->start,
res->end - res->start + 1);
return PTR_ERR(r);