diff options
| author | Ingo Molnar <mingo@kernel.org> | 2024-04-09 09:28:41 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2024-04-09 09:28:41 +0200 |
| commit | 0e6ebfd163645d300fdf4abedd1718195ad293bc (patch) | |
| tree | 510614aa8a43af846e27c7581adda801eaf03fc6 /drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | |
| parent | 186d7ef52c1f0c41450dedbdf6d6325d0a84e4c5 (diff) | |
| parent | fec50db7033ea478773b159e0e2efb135270e3b7 (diff) | |
Merge tag 'v6.9-rc3' into x86/cpu, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c index 55b65fc04b65..431ec72655ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c @@ -129,13 +129,25 @@ static const struct mmu_interval_notifier_ops amdgpu_hmm_hsa_ops = { */ int amdgpu_hmm_register(struct amdgpu_bo *bo, unsigned long addr) { + int r; + if (bo->kfd_bo) - return mmu_interval_notifier_insert(&bo->notifier, current->mm, + r = mmu_interval_notifier_insert(&bo->notifier, current->mm, addr, amdgpu_bo_size(bo), &amdgpu_hmm_hsa_ops); - return mmu_interval_notifier_insert(&bo->notifier, current->mm, addr, - amdgpu_bo_size(bo), - &amdgpu_hmm_gfx_ops); + else + r = mmu_interval_notifier_insert(&bo->notifier, current->mm, addr, + amdgpu_bo_size(bo), + &amdgpu_hmm_gfx_ops); + if (r) + /* + * Make sure amdgpu_hmm_unregister() doesn't call + * mmu_interval_notifier_remove() when the notifier isn't properly + * initialized. + */ + bo->notifier.mm = NULL; + + return r; } /** |
