Skip to contentSkip to conversation

Patch "drm/i915: Flush pending GTT writes before unbinding" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 27, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/i915: Flush pending GTT writes before unbinding

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-i915-flush-pending-gtt-writes-before-unbinding.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 2797c4a11f373b2545c2398ccb02e362ee66a142 Mon Sep 17 00:00:00 2001

From: Chris Wilson <[email protected]>
Date: Mon, 4 Dec 2017 13:25:13 +0000
Subject: drm/i915: Flush pending GTT writes before unbinding

From: Chris Wilson <[email protected]>

commit 2797c4a11f373b2545c2398ccb02e362ee66a142 upstream.

Quoted 1 line

From the shrinker paths, we want to relinquish the GPU and GGTT access to

the object, releasing the backing storage back to the system for swapout. As a part of that process we would unpin the pages, marking them for access by the CPU (for the swapout/swapin). However, if that process was interrupted after unbind the vma, we missed a flush of the inflight GGTT writes before we made that GTT space available again for reuse, with the prospect that we would redirect them to another page.

The bug dates back to the introduction of multiple GGTT vma, but the code itself dates to commit 02bef8f98d26 ("drm/i915: Unbind closed vma for i915_gem_object_unbind()").

Fixes 02bef8f98d26 ("drm/i915: Unbind closed vma for i915_gem_object_unbind()")
Fixes c5ad54cf7dd8 ("drm/i915: Use partial view in mmap fault handler")
Cc Joonas Lahtinen <[email protected]>
(cherry picked from commit 5888fc9eac3c2ff96e76aeeb865fdb46ab2d711e)
---
 drivers/gpu/drm/i915/i915_gem.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +1 -8
@@ -325,17 +325,10 @@ int i915_gem_object_unbind(struct drm_i9
 	 * must wait for all rendering to complete to the object (as unbinding
 	 * must anyway), and retire the requests.
 	 */
-	ret = i915_gem_object_wait(obj,
-				   I915_WAIT_INTERRUPTIBLE |
-				   I915_WAIT_LOCKED |
-				   I915_WAIT_ALL,
-				   MAX_SCHEDULE_TIMEOUT,
-				   NULL);
+	ret = i915_gem_object_set_to_cpu_domain(obj, false);
 	if (ret)
 		return ret;
 
-	i915_gem_retire_requests(to_i915(obj->base.dev));
-
 	while ((vma = list_first_entry_or_null(&obj->vma_list,
 					       struct i915_vma,
 					       obj_link))) {

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/drm-i915-flush-pending-gtt-writes-before-unbinding.patch