dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Morton <jonathan.morton@movial.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] ttm_get_pages() will OOPS with highmem allocation
Date: Tue, 13 Nov 2012 20:31:55 +0200	[thread overview]
Message-ID: <20121113203155.0c1880d9@sd070> (raw)

Reposting from this kernel bug:
https://bugzilla.kernel.org/show_bug.cgi?id=50241

I've tested the patch and it solves a highly repeatable OOPS with the
CedarView driver that I'm porting.


>From 3552913d3a1c2d3c4ce158e91dc18cd12b522cb2 Mon Sep 17 00:00:00 2001
From: Yakui Zhao <yakui.zhao@intel.com>
Date: Tue, 7 Feb 2012 15:33:13 -0500
Subject: [PATCH] Clear the ttm page allocated from high memory zone correctly

The TTM page can be allocated from high memory. In such case it is
wrong to use the page_address(page) as the virtual address for the high memory
page.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
---
 drivers/gpu/drm/ttm/ttm_page_alloc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index d948575..df976d9 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -708,7 +708,10 @@ int ttm_get_pages(struct list_head *pages, int flags,
 	/* clear the pages coming from the pool if requested */
 	if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
 		list_for_each_entry(p, pages, lru) {
-			clear_page(page_address(p));
+			if (PageHighMem(p))
+				clear_highpage(p);
+			else
+				clear_page(page_address(p));
 		}
 	}
 
-- 
1.7.7.6



-- 
From: Jonathan Morton
      jonathan.morton@movial.com

             reply	other threads:[~2012-11-13 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 18:31 Jonathan Morton [this message]
2012-11-14  8:48 ` [PATCH] ttm_get_pages() will OOPS with highmem allocation Thomas Hellstrom
  -- strict thread matches above, loose matches on Subject: below --
2012-11-16 17:19 Jonathan Morton
2012-11-16 17:32 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121113203155.0c1880d9@sd070 \
    --to=jonathan.morton@movial.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox