From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Hellstrom Subject: Re: [PATCH] ttm_get_pages() will OOPS with highmem allocation Date: Wed, 14 Nov 2012 09:48:52 +0100 Message-ID: <50A35AF4.2070908@vmware.com> References: <20121113203155.0c1880d9@sd070> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com [208.91.2.12]) by gabe.freedesktop.org (Postfix) with ESMTP id C38A79F69B for ; Wed, 14 Nov 2012 00:48:56 -0800 (PST) In-Reply-To: <20121113203155.0c1880d9@sd070> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Jonathan Morton Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 11/13/2012 07:31 PM, Jonathan Morton wrote: > 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 > 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 > --- > 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)); > } > } > This is a pretty bad bug. I think the only reason it hasn't been hit more often is that TTM_PAGE_FLAG_ZERO_ALLOC may not be used that often. Please resend this patch with Cc: stable@vger.kernel.org Reviewed-by: Thomas Hellstrom Thanks, Thomas