[tip:x86/pat] Revert "gpu/drm, x86, PAT: PAT support for io_mapping_*"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  f5c1aa1537be39d8b9bb5279b5881d81898fd3cd
Gitweb:     http://git.kernel.org/tip/f5c1aa1537be39d8b9bb5279b5881d81898fd3cd
Author:     Ingo Molnar <mingo@xxxxxxx>
AuthorDate: Sun, 1 Mar 2009 12:32:08 +0100
Commit:     Ingo Molnar <mingo@xxxxxxx>
CommitDate: Sun, 1 Mar 2009 12:47:49 +0100

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@xxxxxxxxx>
Bisected-by: Sitsofe Wheeler <sitsofe@xxxxxxxxx>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Cc: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 arch/x86/include/asm/iomap.h |    5 +---
 arch/x86/mm/iomap_32.c       |   44 +----------------------------------------
 include/linux/io-mapping.h   |    6 +---
 3 files changed, 5 insertions(+), 50 deletions(-)

diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h
index bd46495..86af260 100644
--- a/arch/x86/include/asm/iomap.h
+++ b/arch/x86/include/asm/iomap.h
@@ -24,10 +24,7 @@
 #include <asm/tlbflush.h>
 
 int
-reserve_io_memtype_wc(u64 base, unsigned long size, pgprot_t *prot);
-
-void
-free_io_memtype(u64 base, unsigned long size);
+is_io_mapping_possible(resource_size_t base, unsigned long size);
 
 void *
 iomap_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 d5e2842..6c2b1af 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -21,13 +21,13 @@
 #include <linux/module.h>
 
 #ifdef CONFIG_X86_PAE
-static int
+int
 is_io_mapping_possible(resource_size_t base, unsigned long size)
 {
 	return 1;
 }
 #else
-static int
+int
 is_io_mapping_possible(resource_size_t base, unsigned long size)
 {
 	/* 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)
 }
 #endif
 
-int
-reserve_io_memtype_wc(u64 base, unsigned long size, pgprot_t *prot)
-{
-	unsigned long ret_flag;
-
-	if (!is_io_mapping_possible(base, size))
-		goto out_err;
-
-	if (!pat_enabled) {
-		*prot = pgprot_noncached(PAGE_KERNEL);
-		return 0;
-	}
-
-	if (reserve_memtype(base, base + size, _PAGE_CACHE_WC, &ret_flag))
-		goto out_err;
-
-	if (ret_flag == _PAGE_CACHE_WB)
-		goto out_free;
-
-	if (kernel_map_sync_memtype(base, size, ret_flag))
-		goto out_free;
-
-	*prot = __pgprot(__PAGE_KERNEL | ret_flag);
-	return 0;
-
-out_free:
-	free_memtype(base, base + size);
-out_err:
-	return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(reserve_io_memtype_wc);
-
-void
-free_io_memtype(u64 base, unsigned long size)
-{
-	if (pat_enabled)
-		free_memtype(base, base + size);
-}
-EXPORT_SYMBOL_GPL(free_io_memtype);
-
 /* Map 'pfn' using fixed map 'type' and protections 'prot'
  */
 void *
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index f1ed66c..cbc2f0c 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -49,9 +49,8 @@ static inline struct io_mapping *
 io_mapping_create_wc(resource_size_t base, unsigned long size)
 {
 	struct io_mapping *iomap;
-	pgprot_t prot;
 
-	if (!reserve_io_memtype_wc(base, size, &prot))
+	if (!is_io_mapping_possible(base, size))
 		return NULL;
 
 	iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
@@ -60,14 +59,13 @@ io_mapping_create_wc(resource_size_t base, unsigned long size)
 
 	iomap->base = base;
 	iomap->size = size;
-	iomap->prot = prot;
+	iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL));
 	return iomap;
 }
 
 static inline void
 io_mapping_free(struct io_mapping *mapping)
 {
-	free_io_memtype(mapping->base, mapping->size);
 	kfree(mapping);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux