Skip to contentSkip to conversation

Patch "drm/i915: Unalias obj->phys_handle and obj->userptr" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Oct 28, 2016

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: Unalias obj->phys_handle and obj->userptr

to the 4.4-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-unalias-obj-phys_handle-and-obj-userptr.patch
and it can be found in the queue-4.4 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 ca5732c53bf66ad755284786897e0dd10330de87 Mon Sep 17 00:00:00 2001

From: Chris Wilson <[email protected]>
Date: Mon, 3 Oct 2016 13:45:15 +0100
Subject: drm/i915: Unalias obj->phys_handle and obj->userptr

From: Chris Wilson <[email protected]>

commit ca5732c53bf66ad755284786897e0dd10330de87 upstream.

We use obj->phys_handle to choose the pread/pwrite path, but as obj->phys_handle is a union with obj->userptr, we then mistakenly use the phys_handle path for userptr objects within pread/pwrite.

Testcase: igt/gem_userptr_blits/forbidden-operations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97519

---
 drivers/gpu/drm/i915/i915_drv.h |   24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +11 -13
@@ -2150,21 +2150,19 @@ struct drm_i915_gem_object {
 	/** Record of address bit 17 of each page at last unbind. */
 	unsigned long *bit_17;
 
-	union {
-		/** for phy allocated objects */
-		struct drm_dma_handle *phys_handle;
-
-		struct i915_gem_userptr {
-			uintptr_t ptr;
-			unsigned read_only :1;
-			unsigned workers :4;
+	struct i915_gem_userptr {
+		uintptr_t ptr;
+		unsigned read_only :1;
+		unsigned workers :4;
 #define I915_GEM_USERPTR_MAX_WORKERS 15
 
-			struct i915_mm_struct *mm;
-			struct i915_mmu_object *mmu_object;
-			struct work_struct *work;
-		} userptr;
-	};
+		struct i915_mm_struct *mm;
+		struct i915_mmu_object *mmu_object;
+		struct work_struct *work;
+	} userptr;
+
+	/** for phys allocated objects */
+	struct drm_dma_handle *phys_handle;
 };
 #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
 

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

queue-4.4/drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch queue-4.4/revert-drm-i915-check-live-status-before-reading-edid.patch queue-4.4/drm-prime-pass-the-right-module-owner-through-to-dma_buf_export.patch queue-4.4/drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch