linux-mips
[Top] [All Lists]

[PATCH 3/3] MIPS: handle write_combine in pci_mmap_page_range

To: linux-mips@linux-mips.org
Subject: [PATCH 3/3] MIPS: handle write_combine in pci_mmap_page_range
From: Zhang Le <r0bertz@gentoo.org>
Date: Fri, 8 May 2009 14:30:03 +0800
Cc: Zhang Le <r0bertz@gentoo.org>
In-reply-to: <fb705e2eb405eea04853ae53639457a295a7dd90.1241764065.git.r0bertz@gentoo.org>
In-reply-to: <cover.1241764064.git.r0bertz@gentoo.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cover.1241764064.git.r0bertz@gentoo.org> <a1356a5b181a188435ff569b4f7abe57cf8fd7eb.1241764065.git.r0bertz@gentoo.org> <fb705e2eb405eea04853ae53639457a295a7dd90.1241764065.git.r0bertz@gentoo.org>
References: <cover.1241764064.git.r0bertz@gentoo.org>
Sender: linux-mips-bounce@linux-mips.org
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
---
 arch/mips/pci/pci.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index b0eb9e7..4ca53ef 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,
-- 
1.6.2.3


<Prev in Thread] Current Thread [Next in Thread>