Skip to content

Commit

Permalink
ARM: 5848/1: kill flush_ioremap_region()
Browse files Browse the repository at this point in the history
There is not enough users to warrant its existence, and it is actually
an obstacle to progress with the new DMA API which cannot cover this
case properly.

To keep backward compatibility, let's perform the necessary custom
cache maintenance locally in the only driver affected.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Nicolas Pitre authored and Russell King committed Dec 14, 2009
1 parent 3067e02 commit ccaf5f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 0 additions & 7 deletions arch/arm/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,6 @@ static inline void flush_kernel_dcache_page(struct page *page)
*/
#define flush_icache_page(vma,page) do { } while (0)

static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
unsigned offset, size_t size)
{
const void *start = (void __force *)virt + offset;
dmac_inv_range(start, start + size);
}

/*
* flush_cache_vmap() is used when creating mappings (eg, via vmap,
* vmalloc, ioremap etc) in kernel space for pages. On non-VIPT
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mm/proc-syms.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ EXPORT_SYMBOL(__cpuc_flush_user_all);
EXPORT_SYMBOL(__cpuc_flush_user_range);
EXPORT_SYMBOL(__cpuc_coherent_kern_range);
EXPORT_SYMBOL(__cpuc_flush_dcache_page);
EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */
#else
EXPORT_SYMBOL(cpu_cache);
#endif
Expand Down
13 changes: 11 additions & 2 deletions drivers/mtd/maps/pxa2xx-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@

#include <asm/io.h>
#include <mach/hardware.h>
#include <asm/cacheflush.h>

#include <asm/mach/flash.h>

#define CACHELINESIZE 32

static void pxa2xx_map_inval_cache(struct map_info *map, unsigned long from,
ssize_t len)
{
flush_ioremap_region(map->phys, map->cached, from, len);
unsigned long start = (unsigned long)map->cached + from;
unsigned long end = start + len;

start &= ~(CACHELINESIZE - 1);
while (start < end) {
/* invalidate D cache line */
asm volatile ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start));
start += CACHELINESIZE;
}
}

struct pxa2xx_flash_info {
Expand Down

0 comments on commit ccaf5f0

Please sign in to comment.