aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-01 06:32:08 -0500
committerIngo Molnar <mingo@elte.hu>2009-03-01 06:47:49 -0500
commitf5c1aa1537be39d8b9bb5279b5881d81898fd3cd (patch)
tree6c7fbfb902aaff55a8893c41e54145ef58d6dddc /arch/x86
parentecc25fbd6b9e07b33895c61ddf84006b00f55d99 (diff)
Revert "gpu/drm, x86, PAT: PAT support for io_mapping_*"
This reverts commit 17581ad812a9abb0182260374ef2e52d4a808a64. Sitsofe Wheeler reported that /dev/dri/card0 is MIA on his EeePC 900 and bisected it to this commit. Graphics card is an i915 in an EeePC 900: 00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller [8086:2592] (rev 04) ( Most likely the ioremap() of the driver failed and hence the card did not initialize. ) Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com> Bisected-by: Sitsofe Wheeler <sitsofe@yahoo.com> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/iomap.h5
-rw-r--r--arch/x86/mm/iomap_32.c44
2 files changed, 3 insertions, 46 deletions
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h
index bd46495ff7de..86af26091d6c 100644
--- a/arch/x86/include/asm/iomap.h
+++ b/arch/x86/include/asm/iomap.h
@@ -24,10 +24,7 @@
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25 25
26int 26int
27reserve_io_memtype_wc(u64 base, unsigned long size, pgprot_t *prot); 27is_io_mapping_possible(resource_size_t base, unsigned long size);
28
29void
30free_io_memtype(u64 base, unsigned long size);
31 28
32void * 29void *
33iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); 30iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
index d5e28424622c..6c2b1af16926 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -21,13 +21,13 @@
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23#ifdef CONFIG_X86_PAE 23#ifdef CONFIG_X86_PAE
24static int 24int
25is_io_mapping_possible(resource_size_t base, unsigned long size) 25is_io_mapping_possible(resource_size_t base, unsigned long size)
26{ 26{
27 return 1; 27 return 1;
28} 28}
29#else 29#else
30static int 30int
31is_io_mapping_possible(resource_size_t base, unsigned long size) 31is_io_mapping_possible(resource_size_t base, unsigned long size)
32{ 32{
33 /* There is no way to map greater than 1 << 32 address without PAE */ 33 /* There is no way to map greater than 1 << 32 address without PAE */
@@ -38,46 +38,6 @@ is_io_mapping_possible(resource_size_t base, unsigned long size)
38} 38}
39#endif 39#endif
40 40
41int
42reserve_io_memtype_wc(u64 base, unsigned long size, pgprot_t *prot)
43{
44 unsigned long ret_flag;
45
46 if (!is_io_mapping_possible(base, size))
47 goto out_err;
48
49 if (!pat_enabled) {
50 *prot = pgprot_noncached(PAGE_KERNEL);
51 return 0;
52 }
53
54 if (reserve_memtype(base, base + size, _PAGE_CACHE_WC, &ret_flag))
55 goto out_err;
56
57 if (ret_flag == _PAGE_CACHE_WB)
58 goto out_free;
59
60 if (kernel_map_sync_memtype(base, size, ret_flag))
61 goto out_free;
62
63 *prot = __pgprot(__PAGE_KERNEL | ret_flag);
64 return 0;
65
66out_free:
67 free_memtype(base, base + size);
68out_err:
69 return -EINVAL;
70}
71EXPORT_SYMBOL_GPL(reserve_io_memtype_wc);
72
73void
74free_io_memtype(u64 base, unsigned long size)
75{
76 if (pat_enabled)
77 free_memtype(base, base + size);
78}
79EXPORT_SYMBOL_GPL(free_io_memtype);
80
81/* Map 'pfn' using fixed map 'type' and protections 'prot' 41/* Map 'pfn' using fixed map 'type' and protections 'prot'
82 */ 42 */
83void * 43void *