Optimise the powerpc flushing path for TTM.
Signed-off-by: Dave Airlie <airlied@redhat.com>
ttm_tt_clflush_page(*pages++);
mb();
}
-#else
+#elif !defined(__powerpc__)
static void ttm_tt_ipi_handler(void *null)
{
;
ttm_tt_cache_flush_clflush(pages, num_pages);
return;
}
+#elif defined(__powerpc__)
+ unsigned long i;
+
+ for (i = 0; i < num_pages; ++i) {
+ if (pages[i]) {
+ unsigned long start = (unsigned long)page_address(pages[i]);
+ flush_dcache_range(start, start + PAGE_SIZE);
+ }
+ }
#else
if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0)
printk(KERN_ERR TTM_PFX