Skip to contentSkip to conversation

powerpc: Add pgprot_writecombine

PATCH In review Anton Blanchard 3 participants 3 messages Mar 1, 2011 – Mar 14, 2011 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Add pgprot_writecombine

A number of drivers are using pgprot_writecombine() to enable write combining on userspace mappings. Implement it on powerpc.

---

arch/powerpc/include/asm/pgtable.h +1 -0
index 89f1587..88b0bd9 100644
@@ -170,6 +170,7 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addre
 #define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_CTL) | \
 				            _PAGE_COHERENT | _PAGE_WRITETHRU))
 
+#define pgprot_writecombine pgprot_noncached_wc
 
 struct file;
 extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
#1 lore raw
Quoted 3 lines · Anton Blanchard

A number of drivers are using pgprot_writecombine() to enable write combining on userspace mappings. Implement it on powerpc.

Given this patch, should drivers/infiniband/hw/cxgb4/t4.h

be updated?:

static inline pgprot_t t4_pgprot_wc(pgprot_t prot) {

#if defined(__i386__) || defined(__x86_64__)
        return pgprot_writecombine(prot);
#elif defined(CONFIG_PPC64)
        return __pgprot((pgprot_val(prot) | _PAGE_NO_CACHE) &
                        ~(pgprot_t)_PAGE_GUARDED);
#else
        return pgprot_noncached(prot);

#endif
}

Thanks,
Nish

Quoted 19 lines

---

arch/powerpc/include/asm/pgtable.h +1 -0
index 89f1587..88b0bd9 100644
@@ -170,6 +170,7 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addre
 #define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_CTL) | \
 				            _PAGE_COHERENT | _PAGE_WRITETHRU))
 
+#define pgprot_writecombine pgprot_noncached_wc
 
 struct file;
 extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Signature · 2 lines
Nishanth Aravamudan <[email protected]>
IBM Linux Technology Center
#2 lore raw
Quoted 7 lines · Nishanth Aravamudan
Quoted 2 lines · Anton Blanchard

A number of drivers are using pgprot_writecombine() to enable write combining on userspace mappings. Implement it on powerpc.

Given this patch, should drivers/infiniband/hw/cxgb4/t4.h

be updated?:

Yes.

Quoted 34 lines

static inline pgprot_t t4_pgprot_wc(pgprot_t prot) {

#if defined(__i386__) || defined(__x86_64__)
         return pgprot_writecombine(prot);
#elif defined(CONFIG_PPC64)
         return __pgprot((pgprot_val(prot) | _PAGE_NO_CACHE)&
                         ~(pgprot_t)_PAGE_GUARDED);
#else
         return pgprot_noncached(prot);

#endif
}

Thanks,
Nish

Quoted 19 lines

---

arch/powerpc/include/asm/pgtable.h +1 -0
index 89f1587..88b0bd9 100644
@@ -170,6 +170,7 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addre
  #define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot)&  ~_PAGE_CACHE_CTL) | \
  				            _PAGE_COHERENT | _PAGE_WRITETHRU))
 
+#define pgprot_writecombine pgprot_noncached_wc
 
  struct file;
  extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev