All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ttm_get_pages() will OOPS with highmem allocation
@ 2012-11-13 18:31 Jonathan Morton
  2012-11-14  8:48 ` Thomas Hellstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Morton @ 2012-11-13 18:31 UTC (permalink / raw)
  To: dri-devel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ttm_get_pages() will OOPS with highmem allocation
  2012-11-13 18:31 [PATCH] ttm_get_pages() will OOPS with highmem allocation Jonathan Morton
@ 2012-11-14  8:48 ` Thomas Hellstrom
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Hellstrom @ 2012-11-14  8:48 UTC (permalink / raw)
  To: Jonathan Morton; +Cc: dri-devel

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 <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));
>   		}
>   	}
>   

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 <thellstrom@vmware.com>

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ttm_get_pages() will OOPS with highmem allocation
@ 2012-11-16 17:19 Jonathan Morton
  2012-11-16 17:32 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Morton @ 2012-11-16 17:19 UTC (permalink / raw)
  To: dri-devel; +Cc: stable

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.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>

>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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ttm_get_pages() will OOPS with highmem allocation
  2012-11-16 17:19 Jonathan Morton
@ 2012-11-16 17:32 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2012-11-16 17:32 UTC (permalink / raw)
  To: Jonathan Morton; +Cc: stable, dri-devel

On Fri, Nov 16, 2012 at 07:19:01PM +0200, 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.
> 
> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-16 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 18:31 [PATCH] ttm_get_pages() will OOPS with highmem allocation Jonathan Morton
2012-11-14  8:48 ` 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

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.