Skip to content

Commit 406d7d4

Browse files
Fuad Tabbawilldeacon
authored andcommitted
arm64: __clean_dcache_area_pou to take end parameter instead of size
To be consistent with other functions with similar names and functionality in cacheflush.h, cache.S, and cachetlb.rst, change to specify the range in terms of start and end, as opposed to start and size. No functional change intended. Reported-by: Will Deacon <will@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Fuad Tabba <tabba@google.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20210524083001.2586635-16-tabba@google.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent f749448 commit 406d7d4

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

arch/arm64/include/asm/cacheflush.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern void __flush_dcache_area(unsigned long start, unsigned long end);
6262
extern void __inval_dcache_area(unsigned long start, unsigned long end);
6363
extern void __clean_dcache_area_poc(unsigned long start, unsigned long end);
6464
extern void __clean_dcache_area_pop(unsigned long start, unsigned long end);
65-
extern void __clean_dcache_area_pou(void *addr, size_t len);
65+
extern void __clean_dcache_area_pou(unsigned long start, unsigned long end);
6666
extern long __flush_cache_user_range(unsigned long start, unsigned long end);
6767
extern void sync_icache_aliases(void *kaddr, unsigned long len);
6868

arch/arm64/mm/cache.S

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,19 @@ SYM_FUNC_START_PI(__flush_dcache_area)
113113
SYM_FUNC_END_PI(__flush_dcache_area)
114114

115115
/*
116-
* __clean_dcache_area_pou(kaddr, size)
116+
* __clean_dcache_area_pou(start, end)
117117
*
118-
* Ensure that any D-cache lines for the interval [kaddr, kaddr+size)
118+
* Ensure that any D-cache lines for the interval [start, end)
119119
* are cleaned to the PoU.
120120
*
121-
* - kaddr - kernel address
122-
* - size - size in question
121+
* - start - virtual start address of region
122+
* - end - virtual end address of region
123123
*/
124124
SYM_FUNC_START(__clean_dcache_area_pou)
125125
alternative_if ARM64_HAS_CACHE_IDC
126126
dsb ishst
127127
ret
128128
alternative_else_nop_endif
129-
add x1, x0, x1
130129
dcache_by_line_op cvau, ish, x0, x1, x2, x3
131130
ret
132131
SYM_FUNC_END(__clean_dcache_area_pou)

arch/arm64/mm/flush.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void sync_icache_aliases(void *kaddr, unsigned long len)
1919
unsigned long addr = (unsigned long)kaddr;
2020

2121
if (icache_is_aliasing()) {
22-
__clean_dcache_area_pou(kaddr, len);
22+
__clean_dcache_area_pou(kaddr, kaddr + len);
2323
__flush_icache_all();
2424
} else {
2525
/*

0 commit comments

Comments
 (0)