Skip to content

Commit 25654a1

Browse files
mairacanalRob Clark
authored andcommitted
drm/msm: Update global fault counter when faulty process has already ended
The global fault counter is no longer used since commit 12578c0 ("drm/msm/gpu: Skip retired submits in recover worker"). However, it's still needed, as we need to handle cases where a GPU fault occurs after the faulting process has already ended. Hence, increment the global fault counter when the submitting process had already ended. This way, the number of faults returned by MSM_PARAM_FAULTS will stay consistent. While here, s/unusuable/unusable. Fixes: 12578c0 ("drm/msm/gpu: Skip retired submits in recover worker") Signed-off-by: Maíra Canal <mcanal@igalia.com> Patchwork: https://patchwork.freedesktop.org/patch/664853/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
1 parent f4ca529 commit 25654a1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ static void recover_worker(struct kthread_work *work)
465465
struct msm_gem_submit *submit;
466466
struct msm_ringbuffer *cur_ring = gpu->funcs->active_ring(gpu);
467467
char *comm = NULL, *cmd = NULL;
468+
struct task_struct *task;
468469
int i;
469470

470471
mutex_lock(&gpu->lock);
@@ -482,16 +483,20 @@ static void recover_worker(struct kthread_work *work)
482483

483484
/* Increment the fault counts */
484485
submit->queue->faults++;
485-
if (submit->vm) {
486+
487+
task = get_pid_task(submit->pid, PIDTYPE_PID);
488+
if (!task)
489+
gpu->global_faults++;
490+
else {
486491
struct msm_gem_vm *vm = to_msm_vm(submit->vm);
487492

488493
vm->faults++;
489494

490495
/*
491496
* If userspace has opted-in to VM_BIND (and therefore userspace
492-
* management of the VM), faults mark the VM as unusuable. This
497+
* management of the VM), faults mark the VM as unusable. This
493498
* matches vulkan expectations (vulkan is the main target for
494-
* VM_BIND)
499+
* VM_BIND).
495500
*/
496501
if (!vm->managed)
497502
msm_gem_vm_unusable(submit->vm);

0 commit comments

Comments
 (0)