···134134 /*135135 * Flush user cache and TLB mappings, and then remove this CPU136136 * from the vm mask set of all processes.137137+ *138138+ * Caches are flushed to the Level of Unification Inner Shareable139139+ * to write-back dirty lines to unified caches shared by all CPUs.137140 */138138- flush_cache_all();141141+ flush_cache_louis();139142 local_flush_tlb_all();140143141144 clear_tasks_mm_cpumask(cpu);
+16-1
arch/arm/kernel/suspend.c
···1717 */1818void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)1919{2020+ u32 *ctx = ptr;2121+2022 *save_ptr = virt_to_phys(ptr);21232224 /* This must correspond to the LDM in cpu_resume() assembly */···28262927 cpu_do_suspend(ptr);30283131- flush_cache_all();2929+ flush_cache_louis();3030+3131+ /*3232+ * flush_cache_louis does not guarantee that3333+ * save_ptr and ptr are cleaned to main memory,3434+ * just up to the Level of Unification Inner Shareable.3535+ * Since the context pointer and context itself3636+ * are to be retrieved with the MMU off that3737+ * data must be cleaned from all cache levels3838+ * to main memory using "area" cache primitives.3939+ */4040+ __cpuc_flush_dcache_area(ctx, ptrsz);4141+ __cpuc_flush_dcache_area(save_ptr, sizeof(*save_ptr));4242+3243 outer_clean_range(*save_ptr, *save_ptr + ptrsz);3344 outer_clean_range(virt_to_phys(save_ptr),3445 virt_to_phys(save_ptr) + sizeof(*save_ptr));
+3
arch/arm/mm/cache-fa.S
···240240 mov pc, lr241241ENDPROC(fa_dma_unmap_area)242242243243+ .globl fa_flush_kern_cache_louis244244+ .equ fa_flush_kern_cache_louis, fa_flush_kern_cache_all245245+243246 __INITDATA244247245248 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
+3
arch/arm/mm/cache-v3.S
···128128ENDPROC(v3_dma_unmap_area)129129ENDPROC(v3_dma_map_area)130130131131+ .globl v3_flush_kern_cache_louis132132+ .equ v3_flush_kern_cache_louis, v3_flush_kern_cache_all133133+131134 __INITDATA132135133136 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
+3
arch/arm/mm/cache-v4.S
···140140ENDPROC(v4_dma_unmap_area)141141ENDPROC(v4_dma_map_area)142142143143+ .globl v4_flush_kern_cache_louis144144+ .equ v4_flush_kern_cache_louis, v4_flush_kern_cache_all145145+143146 __INITDATA144147145148 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
+3
arch/arm/mm/cache-v4wb.S
···251251 mov pc, lr252252ENDPROC(v4wb_dma_unmap_area)253253254254+ .globl v4wb_flush_kern_cache_louis255255+ .equ v4wb_flush_kern_cache_louis, v4wb_flush_kern_cache_all256256+254257 __INITDATA255258256259 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
+3
arch/arm/mm/cache-v4wt.S
···196196ENDPROC(v4wt_dma_unmap_area)197197ENDPROC(v4wt_dma_map_area)198198199199+ .globl v4wt_flush_kern_cache_louis200200+ .equ v4wt_flush_kern_cache_louis, v4wt_flush_kern_cache_all201201+199202 __INITDATA200203201204 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
+3
arch/arm/mm/cache-v6.S
···326326 mov pc, lr327327ENDPROC(v6_dma_unmap_area)328328329329+ .globl v6_flush_kern_cache_louis330330+ .equ v6_flush_kern_cache_louis, v6_flush_kern_cache_all331331+329332 __INITDATA330333331334 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
+42-6
arch/arm/mm/cache-v7.S
···3333 mov pc, lr3434ENDPROC(v7_flush_icache_all)35353636+ /*3737+ * v7_flush_dcache_louis()3838+ *3939+ * Flush the D-cache up to the Level of Unification Inner Shareable4040+ *4141+ * Corrupted registers: r0-r7, r9-r11 (r6 only in Thumb mode)4242+ */4343+4444+ENTRY(v7_flush_dcache_louis)4545+ dmb @ ensure ordering with previous memory accesses4646+ mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr4747+ ands r3, r0, #0xe00000 @ extract LoUIS from clidr4848+ mov r3, r3, lsr #20 @ r3 = LoUIS * 24949+ moveq pc, lr @ return if level == 05050+ mov r10, #0 @ r10 (starting level) = 05151+ b flush_levels @ start flushing cache levels5252+ENDPROC(v7_flush_dcache_louis)5353+3654/*3755 * v7_flush_dcache_all()3856 *···6749 mov r3, r3, lsr #23 @ left align loc bit field6850 beq finished @ if loc is 0, then no need to clean6951 mov r10, #0 @ start clean at cache level 07070-loop1:5252+flush_levels:7153 add r2, r10, r10, lsr #1 @ work out 3x current cache level7254 mov r1, r0, lsr r2 @ extract cache type bits from clidr7355 and r1, r1, #7 @ mask of the bits for current cache only···8971 clz r5, r4 @ find bit position of way size increment9072 ldr r7, =0x7fff9173 ands r7, r7, r1, lsr #13 @ extract max number of the index size9292-loop2:7474+loop1:9375 mov r9, r4 @ create working copy of max way size9494-loop3:7676+loop2:9577 ARM( orr r11, r10, r9, lsl r5 ) @ factor way and cache number into r119678 THUMB( lsl r6, r9, r5 )9779 THUMB( orr r11, r10, r6 ) @ factor way and cache number into r11···10082 THUMB( orr r11, r11, r6 ) @ factor index number into r1110183 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way10284 subs r9, r9, #1 @ decrement the way103103- bge loop3104104- subs r7, r7, #1 @ decrement the index10585 bge loop28686+ subs r7, r7, #1 @ decrement the index8787+ bge loop110688skip:10789 add r10, r10, #2 @ increment cache number10890 cmp r3, r10109109- bgt loop19191+ bgt flush_levels11092finished:11193 mov r10, #0 @ swith back to cache level 011294 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr···137119 THUMB( ldmfd sp!, {r4-r7, r9-r11, lr} )138120 mov pc, lr139121ENDPROC(v7_flush_kern_cache_all)122122+123123+ /*124124+ * v7_flush_kern_cache_louis(void)125125+ *126126+ * Flush the data cache up to Level of Unification Inner Shareable.127127+ * Invalidate the I-cache to the point of unification.128128+ */129129+ENTRY(v7_flush_kern_cache_louis)130130+ ARM( stmfd sp!, {r4-r5, r7, r9-r11, lr} )131131+ THUMB( stmfd sp!, {r4-r7, r9-r11, lr} )132132+ bl v7_flush_dcache_louis133133+ mov r0, #0134134+ ALT_SMP(mcr p15, 0, r0, c7, c1, 0) @ invalidate I-cache inner shareable135135+ ALT_UP(mcr p15, 0, r0, c7, c5, 0) @ I+BTB cache invalidate136136+ ARM( ldmfd sp!, {r4-r5, r7, r9-r11, lr} )137137+ THUMB( ldmfd sp!, {r4-r7, r9-r11, lr} )138138+ mov pc, lr139139+ENDPROC(v7_flush_kern_cache_louis)140140141141/*142142 * v7_flush_cache_all()
+3
arch/arm/mm/proc-arm1020.S
···368368 mov pc, lr369369ENDPROC(arm1020_dma_unmap_area)370370371371+ .globl arm1020_flush_kern_cache_louis372372+ .equ arm1020_flush_kern_cache_louis, arm1020_flush_kern_cache_all373373+371374 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)372375 define_cache_functions arm1020373376
+3
arch/arm/mm/proc-arm1020e.S
···354354 mov pc, lr355355ENDPROC(arm1020e_dma_unmap_area)356356357357+ .globl arm1020e_flush_kern_cache_louis358358+ .equ arm1020e_flush_kern_cache_louis, arm1020e_flush_kern_cache_all359359+357360 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)358361 define_cache_functions arm1020e359362
+3
arch/arm/mm/proc-arm1022.S
···343343 mov pc, lr344344ENDPROC(arm1022_dma_unmap_area)345345346346+ .globl arm1022_flush_kern_cache_louis347347+ .equ arm1022_flush_kern_cache_louis, arm1022_flush_kern_cache_all348348+346349 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)347350 define_cache_functions arm1022348351
+3
arch/arm/mm/proc-arm1026.S
···337337 mov pc, lr338338ENDPROC(arm1026_dma_unmap_area)339339340340+ .globl arm1026_flush_kern_cache_louis341341+ .equ arm1026_flush_kern_cache_louis, arm1026_flush_kern_cache_all342342+340343 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)341344 define_cache_functions arm1026342345
+3
arch/arm/mm/proc-arm920.S
···319319 mov pc, lr320320ENDPROC(arm920_dma_unmap_area)321321322322+ .globl arm920_flush_kern_cache_louis323323+ .equ arm920_flush_kern_cache_louis, arm920_flush_kern_cache_all324324+322325 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)323326 define_cache_functions arm920324327#endif
+3
arch/arm/mm/proc-arm922.S
···321321 mov pc, lr322322ENDPROC(arm922_dma_unmap_area)323323324324+ .globl arm922_flush_kern_cache_louis325325+ .equ arm922_flush_kern_cache_louis, arm922_flush_kern_cache_all326326+324327 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)325328 define_cache_functions arm922326329#endif
+3
arch/arm/mm/proc-arm925.S
···376376 mov pc, lr377377ENDPROC(arm925_dma_unmap_area)378378379379+ .globl arm925_flush_kern_cache_louis380380+ .equ arm925_flush_kern_cache_louis, arm925_flush_kern_cache_all381381+379382 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)380383 define_cache_functions arm925381384
+3
arch/arm/mm/proc-arm926.S
···339339 mov pc, lr340340ENDPROC(arm926_dma_unmap_area)341341342342+ .globl arm926_flush_kern_cache_louis343343+ .equ arm926_flush_kern_cache_louis, arm926_flush_kern_cache_all344344+342345 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)343346 define_cache_functions arm926344347
+3
arch/arm/mm/proc-arm940.S
···267267 mov pc, lr268268ENDPROC(arm940_dma_unmap_area)269269270270+ .globl arm940_flush_kern_cache_louis271271+ .equ arm940_flush_kern_cache_louis, arm940_flush_kern_cache_all272272+270273 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)271274 define_cache_functions arm940272275
+3
arch/arm/mm/proc-arm946.S
···310310 mov pc, lr311311ENDPROC(arm946_dma_unmap_area)312312313313+ .globl arm946_flush_kern_cache_louis314314+ .equ arm946_flush_kern_cache_louis, arm946_flush_kern_cache_all315315+313316 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)314317 define_cache_functions arm946315318
+3
arch/arm/mm/proc-feroceon.S
···415415 mov pc, lr416416ENDPROC(feroceon_dma_unmap_area)417417418418+ .globl feroceon_flush_kern_cache_louis419419+ .equ feroceon_flush_kern_cache_louis, feroceon_flush_kern_cache_all420420+418421 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)419422 define_cache_functions feroceon420423