Skip to content

Commit

Permalink
ttm: Clear the ttm page allocated from high memory zone correctly
Browse files Browse the repository at this point in the history
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.

bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50241

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Zhao Yakui authored and Dave Airlie committed Nov 15, 2012
1 parent 888155b commit ac207ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/ttm/ttm_page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
/* clear the pages coming from the pool if requested */
if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
list_for_each_entry(p, &plist, lru) {
clear_page(page_address(p));
if (PageHighMem(p))
clear_highpage(p);
else
clear_page(page_address(p));
}
}

Expand Down

0 comments on commit ac207ed

Please sign in to comment.