* Patch "drm/radeon: fix userptr BO unpin bug v3" has been added to the 4.0-stable tree
@ 2015-05-15 18:14 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-05-15 18:14 UTC (permalink / raw)
To: monk.liu, alexander.deucher, christian.koenig, gregkh
Cc: stable, stable-commits
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 <stable@vger.kernel.org> know about it.
>From db12973cd581d4e79f4aadd0960948f268d15af7 Mon Sep 17 00:00:00 2001
From: "monk.liu" <monk.liu@amd.com>
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" <monk.liu@amd.com>
commit db12973cd581d4e79f4aadd0960948f268d15af7 upstream.
Fixing a memory leak with userptrs.
v2: clean up the loop, use an iterator instead
v3: remove unused variable
Signed-off-by: monk.liu <monk.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/radeon/radeon_ttm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -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 monk.liu@amd.com are
queue-4.0/drm-radeon-fix-userptr-bo-unpin-bug-v3.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-15 18:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-15 18:14 Patch "drm/radeon: fix userptr BO unpin bug v3" has been added to the 4.0-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.