aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/mm/cache_arc700.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/mm/cache_arc700.c')
-rw-r--r--arch/arc/mm/cache_arc700.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c
index 9e1142729fd1..8c3a3e02ba92 100644
--- a/arch/arc/mm/cache_arc700.c
+++ b/arch/arc/mm/cache_arc700.c
@@ -530,16 +530,9 @@ EXPORT_SYMBOL(dma_cache_wback);
530 */ 530 */
531void flush_icache_range(unsigned long kstart, unsigned long kend) 531void flush_icache_range(unsigned long kstart, unsigned long kend)
532{ 532{
533 unsigned int tot_sz, off, sz; 533 unsigned int tot_sz;
534 unsigned long phy, pfn;
535 534
536 /* printk("Kernel Cache Cohenercy: %lx to %lx\n",kstart, kend); */ 535 WARN(kstart < TASK_SIZE, "%s() can't handle user vaddr", __func__);
537
538 /* This is not the right API for user virtual address */
539 if (kstart < TASK_SIZE) {
540 BUG_ON("Flush icache range for user virtual addr space");
541 return;
542 }
543 536
544 /* Shortcut for bigger flush ranges. 537 /* Shortcut for bigger flush ranges.
545 * Here we don't care if this was kernel virtual or phy addr 538 * Here we don't care if this was kernel virtual or phy addr
@@ -572,6 +565,9 @@ void flush_icache_range(unsigned long kstart, unsigned long kend)
572 * straddles across 2 virtual pages and hence need for loop 565 * straddles across 2 virtual pages and hence need for loop
573 */ 566 */
574 while (tot_sz > 0) { 567 while (tot_sz > 0) {
568 unsigned int off, sz;
569 unsigned long phy, pfn;
570
575 off = kstart % PAGE_SIZE; 571 off = kstart % PAGE_SIZE;
576 pfn = vmalloc_to_pfn((void *)kstart); 572 pfn = vmalloc_to_pfn((void *)kstart);
577 phy = (pfn << PAGE_SHIFT) + off; 573 phy = (pfn << PAGE_SHIFT) + off;