Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 045e769a authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Handle GPU hangs during fault gracefully.



Instead of killing the process, just return no page found and reschedule
the process giving the GPU some time to (hopefully) recover.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 75e9e915
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1340,11 +1340,12 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
	mutex_unlock(&dev->struct_mutex);
	mutex_unlock(&dev->struct_mutex);


	switch (ret) {
	switch (ret) {
	case -EAGAIN:
		set_need_resched();
	case 0:
	case 0:
	case -ERESTARTSYS:
	case -ERESTARTSYS:
		return VM_FAULT_NOPAGE;
		return VM_FAULT_NOPAGE;
	case -ENOMEM:
	case -ENOMEM:
	case -EAGAIN:
		return VM_FAULT_OOM;
		return VM_FAULT_OOM;
	default:
	default:
		return VM_FAULT_SIGBUS;
		return VM_FAULT_SIGBUS;