Skip to contentSkip to conversation

Patch "drm/radeon: fix userptr BO unpin bug v3" has been added to the 4.0-stable tree

PATCH [email protected] 1 participant 1 message May 15, 2015

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/radeon: fix userptr BO unpin bug v3

to the 4.0-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-radeon-fix-userptr-bo-unpin-bug-v3.patch
and it can be found in the queue-4.0 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 db12973cd581d4e79f4aadd0960948f268d15af7 Mon Sep 17 00:00:00 2001

From: "monk.liu" <[email protected]>
Date: Tue, 5 May 2015 09:24:17 +0200
Subject: drm/radeon: fix userptr BO unpin bug v3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: "monk.liu" <[email protected]>

commit db12973cd581d4e79f4aadd0960948f268d15af7 upstream.

Fixing a memory leak with userptrs.

v2: clean up the loop, use an iterator instead
v3: remove unused variable

---
 drivers/gpu/drm/radeon/radeon_ttm.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_ttm.c +3 -5
@@ -591,8 +591,7 @@ static void radeon_ttm_tt_unpin_userptr(
 {
 	struct radeon_device *rdev = radeon_get_rdev(ttm->bdev);
 	struct radeon_ttm_tt *gtt = (void *)ttm;
-	struct scatterlist *sg;
-	int i;
+	struct sg_page_iter sg_iter;
 
 	int write = !(gtt->userflags & RADEON_GEM_USERPTR_READONLY);
 	enum dma_data_direction direction = write ?
@@ -605,9 +604,8 @@ static void radeon_ttm_tt_unpin_userptr(
 	/* free the sg table and pages again */
 	dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
 
-	for_each_sg(ttm->sg->sgl, sg, ttm->sg->nents, i) {
-		struct page *page = sg_page(sg);
-
+	for_each_sg_page(ttm->sg->sgl, &sg_iter, ttm->sg->nents, 0) {
+		struct page *page = sg_page_iter_page(&sg_iter);
 		if (!(gtt->userflags & RADEON_GEM_USERPTR_READONLY))
 			set_page_dirty(page);
 

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

queue-4.0/drm-radeon-fix-userptr-bo-unpin-bug-v3.patch