Thread (32 messages) 32 messages, 5 authors, 2005-04-25

Re: Re: 2.6.12-rc1-mm2 -- nvidiafb driver gives black screen

From: Randy.Dunlap <hidden>
Date: 2005-04-21 18:37:11

On Thu, 21 Apr 2005 09:22:15 -0700 Randy.Dunlap wrote:

| On Thu, 21 Apr 2005 01:51:12 -0400 Miles Lane wrote:
| 
| | Here's what I get when testing 2.6.12-rc2-mm3
| | (I verified that your two patches have been applied in my
| | tree):
| | 
| | Kernel command line: BOOT_IMAGE=Linux ro root=306
| | video=nvidiafb:1280x1024-16@85 vmalloc=
| | 128M init=/etc/init lang=us apm=power-off nomce
| | 
| ...
| | allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
| | nvidiafb: cannot ioremap FB base
| | 
| | When I boot, the screen stays black until XFree86 starts up.
| 
| Tony,
| 
| As I wrote to Miles a few weeks ago:
| "I started looking at vmalloc() and what it calls (which is
| __get_vm_area).  _get_vm_area() always allocates one extra
| page (called a "guard page") between all vmalloc allocations,
| so even though 128 MB is the default amount and the amount
| that nvidiafb wants to use, the kernel wants to allocate
| 128 MB + PAGE_SIZE (4 KB on x86; are you on x86?), so even
| if nvidiafb is the only caller, the vmalloc() call will
| fail."
| 
| This means that the default kernel vmalloc size of 128MB
| cannot be totally (fully) allocated due to this code:
| 	/*
| 	 * We always allocate a guard page.
| 	 */
| 	size += PAGE_SIZE;
| 
| IMO we (somebody) should add the guard page into the default
| vmalloc size so that the full 128MB can be allocated.
| I'll take a look at doing that... no promises.

Miles,

Can you test this patch, please?
(against 2.6.12-rc3 if it matters)

Don't use "vmalloc=size" on the kernel boot line.
The driver should still be able to allocate 128 MB
without using that.



From: Randy Dunlap <redacted>

Include a guard page in the default vmalloc reserved size so that
a vmalloc() of 128 MB will succeed.  Useful for framebuffer drivers
that vmalloc() 128 MB but that currently fails.
Specifying "vmalloc=size" on the kernel command line still allocates
exactly that requested size, with no extra for a guard page.

Signed-off-by: Randy Dunlap <redacted>
---

 arch/i386/mm/init.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -Naurp ./arch/i386/mm/init.c~vmalloc_guard ./arch/i386/mm/init.c
--- ./arch/i386/mm/init.c~vmalloc_guard	2005-04-21 08:15:35.000000000 -0700
+++ ./arch/i386/mm/init.c	2005-04-21 10:50:55.000000000 -0700
@@ -31,6 +31,7 @@
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/dma.h>
 #include <asm/fixmap.h>
@@ -40,7 +41,7 @@
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
 
-unsigned int __VMALLOC_RESERVE = 128 << 20;
+unsigned int __VMALLOC_RESERVE = (128 << 20) + PAGE_SIZE;
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 unsigned long highstart_pfn, highend_pfn;


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help