]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.6.8/ttm-clear-the-ttm-page-allocated-from-high-memory-zone-correctly.patch
move 5.10 queue back in place
[thirdparty/kernel/stable-queue.git] / releases / 3.6.8 / ttm-clear-the-ttm-page-allocated-from-high-memory-zone-correctly.patch
1 From ac207ed2471150e06af0afc76e4becc701fa2733 Mon Sep 17 00:00:00 2001
2 From: Zhao Yakui <yakui.zhao@intel.com>
3 Date: Tue, 13 Nov 2012 18:31:55 +0000
4 Subject: ttm: Clear the ttm page allocated from high memory zone correctly
5
6 From: Zhao Yakui <yakui.zhao@intel.com>
7
8 commit ac207ed2471150e06af0afc76e4becc701fa2733 upstream.
9
10 The TTM page can be allocated from high memory. In such case it is
11 wrong to use the page_address(page) as the virtual address for the high memory
12 page.
13
14 bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50241
15
16 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
17 Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
18 Signed-off-by: Dave Airlie <airlied@redhat.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 drivers/gpu/drm/ttm/ttm_page_alloc.c | 5 ++++-
23 1 file changed, 4 insertions(+), 1 deletion(-)
24
25 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
26 +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
27 @@ -749,7 +749,10 @@ static int ttm_get_pages(struct page **p
28 /* clear the pages coming from the pool if requested */
29 if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
30 list_for_each_entry(p, &plist, lru) {
31 - clear_page(page_address(p));
32 + if (PageHighMem(p))
33 + clear_highpage(p);
34 + else
35 + clear_page(page_address(p));
36 }
37 }
38