diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-02-04 10:47:54 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-04 10:47:54 -0500 |
commit | 38cb47ba0187c481aa949d3bbf149e014e8cacda (patch) | |
tree | ff05de005f1838b8eefedcb03a8247b2c825b5b3 | |
parent | 9135f1901ee6449dfe338adf6e40e9c2025b8150 (diff) |
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 <tglx@linutronix.de>
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 <kjwinchester@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Kevin Winchester <kjwinchester@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | 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 c004d94608fd..1a88d1572a77 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, | |||
116 | { | 116 | { |
117 | void __iomem *addr; | 117 | void __iomem *addr; |
118 | struct vm_struct *area; | 118 | struct vm_struct *area; |
119 | unsigned long offset, last_addr; | 119 | unsigned long pfn, offset, last_addr; |
120 | pgprot_t prot; | 120 | pgprot_t prot; |
121 | 121 | ||
122 | /* Don't allow wraparound or zero size */ | 122 | /* Don't allow wraparound or zero size */ |
@@ -133,9 +133,10 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
133 | /* | 133 | /* |
134 | * Don't allow anybody to remap normal RAM that we're using.. | 134 | * Don't allow anybody to remap normal RAM that we're using.. |
135 | */ | 135 | */ |
136 | for (offset = phys_addr >> PAGE_SHIFT; offset < max_pfn_mapped && | 136 | for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped && |
137 | (offset << PAGE_SHIFT) < last_addr; offset++) { | 137 | (pfn << PAGE_SHIFT) < last_addr; pfn++) { |
138 | if (page_is_ram(offset)) | 138 | if (page_is_ram(pfn) && pfn_valid(pfn) && |
139 | !PageReserved(pfn_to_page(pfn))) | ||
139 | return NULL; | 140 | return NULL; |
140 | } | 141 | } |
141 | 142 | ||