diff options
author | Arjan van dev Ven | 2008-02-06 05:16:00 +0100 |
---|---|---|
committer | Dave Airlie | 2008-02-19 14:46:39 +1000 |
commit | fcea424d31868a78366ad5ee0cb3cc2a4cbe689b (patch) | |
tree | 9b3a2be661c07d8b094a5489ecafffe4befe5ec0 /arch | |
parent | 16469a0ea0f6b7562eac98ebb8a7c41ce902d0b1 (diff) |
fix historic ioremap() abuse in AGP
Several AGP drivers right now use ioremap_nocache() on kernel ram in order
to turn a page of regular memory uncached.
There are two problems with this:
1) This is a total nightmare for the ioremap() implementation to keep
various mappings of the same page coherent.
2) It's a total nightmare for the AGP code since it adds a ton of
complexity in terms of keeping track of 2 different pointers to
the same thing, in terms of error handling etc etc.
This patch fixes this by making the AGP drivers use the new
set_memory_XX APIs instead.
Note: amd-k7-agp.c is built on Alpha too, and generic.c is built
on ia64 as well, which do not yet have the set_memory_*() APIs,
so for them some we have a few ugly #ifdefs - hopefully they'll
be fixed soon.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/ioremap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 9f42d7e9c158..69f4981db80f 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -126,6 +126,8 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, return NULL; } + WARN_ON_ONCE(page_is_ram(pfn)); + switch (mode) { case IOR_MODE_UNCACHED: default: |