From a892c7470d85f9563cc74c766fb4dd7f2fa0b801 Mon Sep 17 00:00:00 2001 From: Zhang Le Date: Fri, 8 May 2009 13:57:01 +0800 Subject: [PATCH] MIPS: handle write_combine in pci_mmap_page_range Signed-off-by: Zhang Le --- arch/mips/pci/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index b0eb9e75c68..4ca53efff3f 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c @@ -346,10 +346,14 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, return -EINVAL; /* - * Ignore write-combine; for now only return uncached mappings. + * For write-combine, return uncached accelerated mappings if CPU + * supports; otherwise, return uncached mappings. */ prot = pgprot_val(vma->vm_page_prot); - prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED; + if (write_combine && cpu_has_uncached_accelerated) + prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED_ACCELERATED; + else + prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED; vma->vm_page_prot = __pgprot(prot); return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, -- 2.11.4.GIT