Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38cb47ba0187c481aa949d3bbf149e014e8cacda
Commit:     38cb47ba0187c481aa949d3bbf149e014e8cacda
Parent:     9135f1901ee6449dfe338adf6e40e9c2025b8150
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 16:47:54 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 16:47:54 2008 +0100

    x86: relax RAM check in ioremap()
    
    Kevin Winchester reported the loss of direct rendering, due to:
    
    [    0.588184] agpgart: Detected AGP bridge 0
    [    0.588184] agpgart: unable to get memory for graphics translation table.
    [    0.588184] agpgart: agp_backend_initialize() failed.
    [    0.588207] agpgart-amd64: probe of 0000:00:00.0 failed with error -12
    
    and bisected it down to:
    
      commit 266b9f8727976769e2ed2dad77ac9295f37e321e
      Author: Thomas Gleixner <[EMAIL PROTECTED]>
      Date:   Wed Jan 30 13:34:06 2008 +0100
    
          x86: fix ioremap RAM check
    
    this check was too strict and caused an ioremap() failure.
    
    the problem is due to the somewhat unclean way of how the GART code
    reserves a memory range for its aperture, and how it utilizes it
    later on.
    
    Allow RAM pages to be ioremap()-ed too, as long as they are reserved.
    
    Bisected-by: Kevin Winchester <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Tested-by: Kevin Winchester <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/ioremap.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index c004d94..1a88d15 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -116,7 +116,7 @@ static void __iomem *__ioremap(unsigned long phys_addr, 
unsigned long size,
 {
        void __iomem *addr;
        struct vm_struct *area;
-       unsigned long offset, last_addr;
+       unsigned long pfn, offset, last_addr;
        pgprot_t prot;
 
        /* Don't allow wraparound or zero size */
@@ -133,9 +133,10 @@ static void __iomem *__ioremap(unsigned long phys_addr, 
unsigned long size,
        /*
         * Don't allow anybody to remap normal RAM that we're using..
         */
-       for (offset = phys_addr >> PAGE_SHIFT; offset < max_pfn_mapped &&
-            (offset << PAGE_SHIFT) < last_addr; offset++) {
-               if (page_is_ram(offset))
+       for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped &&
+            (pfn << PAGE_SHIFT) < last_addr; pfn++) {
+               if (page_is_ram(pfn) && pfn_valid(pfn) &&
+                   !PageReserved(pfn_to_page(pfn)))
                        return NULL;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to