drm/amdkfd: Don't take process mutex for svm ioctls
[ Upstream commit ac7c48c0cc
]
SVM ioctls take proper svms->lock to handle race conditions, don't need
take process mutex to serialize ioctls. This also fixes circular locking
warning:
WARNING: possible circular locking dependency detected
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock((work_completion)(&svms->deferred_list_work));
lock(&process->mutex);
lock((work_completion)(&svms->deferred_list_work));
lock(&process->mutex);
*** DEADLOCK ***
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1eb5980453
commit
e84b043801
@ -1807,13 +1807,9 @@ static int kfd_ioctl_svm(struct file *filep, struct kfd_process *p, void *data)
|
|||||||
if (!args->start_addr || !args->size)
|
if (!args->start_addr || !args->size)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
mutex_lock(&p->mutex);
|
|
||||||
|
|
||||||
r = svm_ioctl(p, args->op, args->start_addr, args->size, args->nattr,
|
r = svm_ioctl(p, args->op, args->start_addr, args->size, args->nattr,
|
||||||
args->attrs);
|
args->attrs);
|
||||||
|
|
||||||
mutex_unlock(&p->mutex);
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user