Skip to contentSkip to conversation

Patch "drm/ttm: Fix 'buf' pointer update in ttm_bo_vm_access_kmap() (v2)" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Feb 20, 2018

Subsystems (4)
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/ttm: Fix 'buf' pointer update in ttm_bo_vm_access_kmap() (v2)

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-ttm-fix-buf-pointer-update-in-ttm_bo_vm_access_kmap-v2.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 95244db2d3f743f37e69446a2807dd1a42750542 Mon Sep 17 00:00:00 2001

From: Tom St Denis <[email protected]>
Date: Fri, 26 Jan 2018 09:32:29 -0500
Subject: drm/ttm: Fix 'buf' pointer update in ttm_bo_vm_access_kmap() (v2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Tom St Denis <[email protected]>

commit 95244db2d3f743f37e69446a2807dd1a42750542 upstream.

The buf pointer was not being incremented inside the loop meaning the same block of data would be read or written repeatedly.
(v2) Change 'buf' pointer to uint8_t* type

Fixes 09ac4fcb3f25 ("drm/ttm: Implement vm_operations_struct.access v2")
---
 drivers/gpu/drm/ttm/ttm_bo_vm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +2 -1
@@ -299,7 +299,7 @@ static void ttm_bo_vm_close(struct vm_ar
 
 static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,
 				 unsigned long offset,
-				 void *buf, int len, int write)
+				 uint8_t *buf, int len, int write)
 {
 	unsigned long page = offset >> PAGE_SHIFT;
 	unsigned long bytes_left = len;
@@ -328,6 +328,7 @@ static int ttm_bo_vm_access_kmap(struct
 		ttm_bo_kunmap(&map);
 
 		page++;
+		buf += bytes;
 		bytes_left -= bytes;
 		offset = 0;
 	} while (bytes_left);

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

queue-4.14/drm-ttm-fix-buf-pointer-update-in-ttm_bo_vm_access_kmap-v2.patch