MIPS: Drop CPU_SUPPORTS_UNCACHED_ACCELERATED
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Thu, 7 Nov 2019 04:01:16 +0000 (12:01 +0800)
committerPaul Burton <paulburton@kernel.org>
Mon, 11 Nov 2019 18:44:57 +0000 (10:44 -0800)
CPU_SUPPORTS_UNCACHED_ACCELERATED was introduced when kernel can't handle
writecombine remap well. Nowadays drivers can try writecombine remap by
themselves so this function is nolonger needed.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: chenhe@lemote.com
arch/mips/Kconfig
arch/mips/include/asm/pgtable.h
arch/mips/loongson2ef/common/mem.c

index 783111156a372fb61ccbbc78d77b975f6366300a..d689aa485d0c7e58b2c2800bcb8342c8ac713ec4 100644 (file)
@@ -1973,7 +1973,6 @@ config SYS_HAS_CPU_LOONGSON2F
        bool
        select CPU_SUPPORTS_CPUFREQ
        select CPU_SUPPORTS_ADDRWINCFG if 64BIT
-       select CPU_SUPPORTS_UNCACHED_ACCELERATED
 
 config SYS_HAS_CPU_LOONGSON1B
        bool
@@ -2150,8 +2149,6 @@ config CPU_SUPPORTS_ADDRWINCFG
 config CPU_SUPPORTS_HUGEPAGES
        bool
        depends on !(32BIT && (ARCH_PHYS_ADDR_T_64BIT || EVA))
-config CPU_SUPPORTS_UNCACHED_ACCELERATED
-       bool
 config MIPS_PGD_C0_CONTEXT
        bool
        default y if 64BIT && (CPU_MIPSR2 || CPU_MIPSR6) && !CPU_XLP
index f85bd5b15f51fc5f6ae29819d0d059546169554a..91b89aab1787ad08b88d2963d922d094a7eb95e2 100644 (file)
@@ -643,17 +643,6 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
 
 #include <asm-generic/pgtable.h>
 
-/*
- * uncached accelerated TLB map for video memory access
- */
-#ifdef CONFIG_CPU_SUPPORTS_UNCACHED_ACCELERATED
-#define __HAVE_PHYS_MEM_ACCESS_PROT
-
-struct file;
-pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
-               unsigned long size, pgprot_t vma_prot);
-#endif
-
 /*
  * We provide our own get_unmapped area to cope with the virtual aliasing
  * constraints placed on us by the cache architecture.
index 11bf6eefb82a0a290e77105b4246e3a0e4997ed1..ae21f1c62baa58fea2f2f531b08488ff6aa387bc 100644 (file)
@@ -60,61 +60,3 @@ int __uncached_access(struct file *file, unsigned long addr)
                ((addr >= LOONGSON_MMIO_MEM_START) &&
                 (addr < LOONGSON_MMIO_MEM_END));
 }
-
-#ifdef CONFIG_CPU_SUPPORTS_UNCACHED_ACCELERATED
-
-#include <linux/pci.h>
-#include <linux/sched.h>
-#include <asm/current.h>
-
-static unsigned long uca_start, uca_end;
-
-pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
-                             unsigned long size, pgprot_t vma_prot)
-{
-       unsigned long offset = pfn << PAGE_SHIFT;
-       unsigned long end = offset + size;
-
-       if (__uncached_access(file, offset)) {
-               if (uca_start && (offset >= uca_start) &&
-                   (end <= uca_end))
-                       return __pgprot((pgprot_val(vma_prot) &
-                                        ~_CACHE_MASK) |
-                                       _CACHE_UNCACHED_ACCELERATED);
-               else
-                       return pgprot_noncached(vma_prot);
-       }
-       return vma_prot;
-}
-
-static int __init find_vga_mem_init(void)
-{
-       struct pci_dev *dev = 0;
-       struct resource *r;
-       int idx;
-
-       if (uca_start)
-               return 0;
-
-       for_each_pci_dev(dev) {
-               if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
-                       for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
-                               r = &dev->resource[idx];
-                               if (!r->start && r->end)
-                                       continue;
-                               if (r->flags & IORESOURCE_IO)
-                                       continue;
-                               if (r->flags & IORESOURCE_MEM) {
-                                       uca_start = r->start;
-                                       uca_end = r->end;
-                                       return 0;
-                               }
-                       }
-               }
-       }
-
-       return 0;
-}
-
-late_initcall(find_vga_mem_init);
-#endif /* !CONFIG_CPU_SUPPORTS_UNCACHED_ACCELERATED */