summaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/cacheflush.h
Commit message (Collapse)AuthorAgeFilesLines
* sh: Assume new page cache pages have dirty dcache lines.Paul Mundt2010-12-011-1/+1
| | | | | | | | | | | | | | | | | | | This follows the ARM change c01778001a4f5ad9c62d882776235f3f31922fdd ("ARM: 6379/1: Assume new page cache pages have dirty D-cache") for the same rationale: There are places in Linux where writes to newly allocated page cache pages happen without a subsequent call to flush_dcache_page() (several PIO drivers including USB HCD). This patch changes the meaning of PG_arch_1 to be PG_dcache_clean and always flush the D-cache for a newly mapped page in update_mmu_cache(). This addresses issues seen with executing binaries from MMC, in addition to some of the other HCDs that don't explicitly do cache management for their pipe-in buffers. Requested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up flush_cache_vmap() on SMP.Paul Mundt2010-03-041-2/+2
| | | | | | | | flush_cache_all() uses broadcast IPIs, so we can't wrap in to that when IRQs are disabled. The local cache flush manages to do what we need here anyways, so just switch to that. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: add mm API for DMA to vmalloc/vmap areasJames Bottomley2010-02-051-0/+8
| | | | Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* block: add helpers to run flush_dcache_page() against a bio and a request's ↵Ilya Loginov2009-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | pages Mtdblock driver doesn't call flush_dcache_page for pages in request. So, this causes problems on architectures where the icache doesn't fill from the dcache or with dcache aliases. The patch fixes this. The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid pointless empty cache-thrashing loops on architectures for which flush_dcache_page() is a no-op. Every architecture was provided with this flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is equal 1 or do nothing otherwise. See "fix mtd_blkdevs problem with caches on some architectures" discussion on LKML for more information. Signed-off-by: Ilya Loginov <isloginov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Peter Horton <phorton@bitbox.co.uk> Cc: "Ed L. Cashin" <ecashin@coraid.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* sh: Fix up and optimize the kmap_coherent() interface.Paul Mundt2009-09-031-1/+1
| | | | | | | | | | | | | This fixes up the kmap_coherent/kunmap_coherent() interface for recent changes both in the page fault path and the shared cache flushers, as well as adding in some optimizations. One of the key things to note here is that the TLB flush itself is deferred until the unmap, and the call in to update_mmu_cache() itself goes away, relying on the regular page fault path to handle the lazy dcache writeback if necessary. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Make cache flushers SMP-aware.Paul Mundt2009-08-211-12/+29
| | | | | | | | This does a bit of rework for making the cache flushers SMP-aware. The function pointer-based flushers are renamed to local variants with the exported interface being commonly implemented and wrapping as necessary. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Kill off unused cpu/cacheflush.h.Paul Mundt2009-08-211-1/+31
| | | | | | | All CPU-specific overloads are done at runtime now, so this common header can go away and simply be folded back in to asm/ version. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Migrate SH-4 cacheflush ops to function pointers.Paul Mundt2009-08-151-36/+1
| | | | | | | | | | This paves the way for allowing individual CPUs to overload the individual flushing routines that they care about without having to depend on weak aliases. SH-4 is converted over initially, as it wires up pretty much everything. The majority of the other CPUs will simply use the default no-op implementation with their own region flushers wired up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Kill off unused flush_icache_user_range().Paul Mundt2009-08-151-1/+0
| | | | | | | | We use flush_cache_page() outright in copy_to_user_page(), and nothing else needs it, so just kill it off. SH-5 still defines its own version, but that too will go away in the same fashion once it converts over. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: consolidate flush_dcache_mmap_lock/unlock() definitions.Paul Mundt2009-08-151-2/+3
| | | | | | | | All of the flush_dcache_mmap_lock()/flush_dcache_mmap_unlock() definitions are identical across all CPUs, so just provide them generically in asm/cacheflush.h. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Centralize the CPU cache initialization routines.Paul Mundt2009-08-151-1/+2
| | | | | | | | This provides a central point for CPU cache initialization routines. This replaces the antiquated p3_cache_init() method, which the vast majority of CPUs never cared about. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: rework nommu for generic cache.c use.Paul Mundt2009-08-151-0/+2
| | | | | | | This does a bit of reorganizing for allowing nommu to use the new and generic cache.c, no functional changes. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: rename pg-mmu.c -> cache.c, enable generically.Paul Mundt2009-08-151-2/+0
| | | | | | | | | This builds in the newly created cache.c (renamed from pg-mmu.c) for both MMU and NOMMU configurations. The kmap_coherent() stubs and alias information recorded by each CPU family takes care of doing the right thing while enabling the code to be commonly shared. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Provide the kmap_coherent() interface generically.Paul Mundt2009-08-151-0/+4
| | | | | | | | | This plugs in kmap_coherent() for the non-SH4 cases to permit the pg-mmu.c bits to be used generically across all CPUs. SH-5 is still in the TODO state, but will move over to fixmap and the generic interface gradually. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Provide __flush_anon_page().Paul Mundt2009-08-041-0/+14
| | | | | | | | This provides a __flush_anon_page() that handles both the aliasing and non-aliasing cases. This fixes up some crashes with heavy get_user_pages() users. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Use the now generic SH-4 clear/copy page ops for all MMU platforms.Paul Mundt2009-07-271-15/+0
| | | | | | | | | | | | Now that the SH-4 page clear/copy ops are generic, they can be used for all platforms with CONFIG_MMU=y. SH-5 remains the odd one out, but it too will gradually be converted over to using this interface. SH-3 platforms which do not contain aliases will see no impact from this change, while aliasing SH-3 platforms will get the same interface as SH-4. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: wire up clear_user_highpage() for sh4, convert sh7705.Paul Mundt2009-07-271-1/+1
| | | | | | | | | This wires up clear_user_highpage() on SH-4 and subsequently converts the SH7705 32kB cache mode over to using it. Now that the SH-4 implementation handles all of the dcache purging directly in the aliasing case, there is no need to do this in the default clear_page() implementation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Handle shm_align_mask also for HAVE_ARCH_UNMAPPED_AREA_TOPDOWN.Paul Mundt2009-05-071-2/+0
| | | | | | | Presently shm_align_mask is only looked at for the bottom up case, but we still want this for proper colouring constraints in the topdown case. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: migrate to arch/sh/include/Paul Mundt2008-07-291-0/+81
This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac. Most of the moving about was done with Sam's directions at: http://marc.info/?l=linux-sh&m=121724823706062&w=2 with subsequent hacking and fixups entirely my fault. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
OpenPOWER on IntegriCloud