Commit 25654a17 authored by Maíra Canal's avatar Maíra Canal Committed by Rob Clark
Browse files

drm/msm: Update global fault counter when faulty process has already ended



The global fault counter is no longer used since commit 12578c07
("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: 12578c07 ("drm/msm/gpu: Skip retired submits in recover worker")
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Patchwork: https://patchwork.freedesktop.org/patch/664853/


Signed-off-by: default avatarRob Clark <robin.clark@oss.qualcomm.com>
parent f4ca529d
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -465,6 +465,7 @@ static void recover_worker(struct kthread_work *work)
	struct msm_gem_submit *submit;
	struct msm_ringbuffer *cur_ring = gpu->funcs->active_ring(gpu);
	char *comm = NULL, *cmd = NULL;
	struct task_struct *task;
	int i;

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

	/* Increment the fault counts */
	submit->queue->faults++;
	if (submit->vm) {

	task = get_pid_task(submit->pid, PIDTYPE_PID);
	if (!task)
		gpu->global_faults++;
	else {
		struct msm_gem_vm *vm = to_msm_vm(submit->vm);

		vm->faults++;

		/*
		 * If userspace has opted-in to VM_BIND (and therefore userspace
		 * management of the VM), faults mark the VM as unusuable.  This
		 * management of the VM), faults mark the VM as unusable. This
		 * matches vulkan expectations (vulkan is the main target for
		 * VM_BIND)
		 * VM_BIND).
		 */
		if (!vm->managed)
			msm_gem_vm_unusable(submit->vm);