[PATCH] ppc32: 8xx commproc avoid direct pte manipulation, use dma coherent API instead

Touching the pte directly causes the 8Mbyte TLB entry to be invalidated.

This has been fixed in v2.4 for ages.

Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Marcelo Tosatti and committed by Linus Torvalds 079da354 204085c5

Changed files
+3 -23
arch
ppc
8xx_io
syslib
+1 -17
arch/ppc/8xx_io/commproc.c
··· 39 39 #include <asm/tlbflush.h> 40 40 #include <asm/rheap.h> 41 41 42 - extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); 43 - 44 42 static void m8xx_cpm_dpinit(void); 45 43 static uint host_buffer; /* One page of host buffer */ 46 44 static uint host_end; /* end + 1 */ ··· 106 108 .end = cpm_eoi, 107 109 }; 108 110 109 - extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 110 - 111 111 void 112 - m8xx_cpm_reset(uint bootpage) 112 + m8xx_cpm_reset(void) 113 113 { 114 114 volatile immap_t *imp; 115 115 volatile cpm8xx_t *commproc; 116 - pte_t *pte; 117 116 118 117 imp = (immap_t *)IMAP_ADDR; 119 118 commproc = (cpm8xx_t *)&imp->im_cpm; ··· 137 142 138 143 /* Reclaim the DP memory for our use. */ 139 144 m8xx_cpm_dpinit(); 140 - 141 - /* get the PTE for the bootpage */ 142 - if (!get_pteptr(&init_mm, bootpage, &pte)) 143 - panic("get_pteptr failed\n"); 144 - 145 - /* and make it uncachable */ 146 - pte_val(*pte) |= _PAGE_NO_CACHE; 147 - _tlbie(bootpage); 148 - 149 - host_buffer = bootpage; 150 - host_end = host_buffer + PAGE_SIZE; 151 145 152 146 /* Tell everyone where the comm processor resides. 153 147 */
+2 -6
arch/ppc/syslib/m8xx_setup.c
··· 57 57 extern void m8xx_ide_init(void); 58 58 59 59 extern unsigned long find_available_memory(void); 60 - extern void m8xx_cpm_reset(uint cpm_page); 60 + extern void m8xx_cpm_reset(); 61 61 extern void m8xx_wdt_handler_install(bd_t *bp); 62 62 extern void rpxfb_alloc_pages(void); 63 63 extern void cpm_interrupt_init(void); ··· 70 70 void __init 71 71 m8xx_setup_arch(void) 72 72 { 73 - int cpm_page; 74 - 75 - cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE); 76 - 77 73 /* Reset the Communication Processor Module. 78 74 */ 79 - m8xx_cpm_reset(cpm_page); 75 + m8xx_cpm_reset(); 80 76 81 77 #ifdef CONFIG_FB_RPX 82 78 rpxfb_alloc_pages();