drm/xe: Fix ref counting leak on page fault
BugLink: https://bugs.launchpad.net/bugs/2060097
[ Upstream commit f7da398935f7ddabf1a098714593e032c875cd74 ]
If a page fault occurs on VM not in fault a ref can be leaked. Fix this.
Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240301041036.238471-1-matthew.brost@intel.com
(cherry picked from commit 27b5a3f237fe66dbf2288c2b50973aee8a427e41)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 56aba4e947c23e95be951f71da5ec70afcb4303d)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
committed by
Roxana Nicolescu
parent
1c3b70785f
commit
35ea9bd921
@@ -146,10 +146,12 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
|
||||
/* ASID to VM */
|
||||
mutex_lock(&xe->usm.lock);
|
||||
vm = xa_load(&xe->usm.asid_to_vm, pf->asid);
|
||||
if (vm)
|
||||
if (vm && xe_vm_in_fault_mode(vm))
|
||||
xe_vm_get(vm);
|
||||
else
|
||||
vm = NULL;
|
||||
mutex_unlock(&xe->usm.lock);
|
||||
if (!vm || !xe_vm_in_fault_mode(vm))
|
||||
if (!vm)
|
||||
return -EINVAL;
|
||||
|
||||
retry_userptr:
|
||||
|
||||
Reference in New Issue
Block a user