mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
csky: syscache: Fixup duplicate cache flush
[ Upstream commit6ea42c84f3] The current csky logic of sys_cacheflush is wrong, it'll cause icache flush call dcache flush again. Now fixup it with a conditional "break & fallthrough". Fixes:997153b9a7("csky: Add flush_icache_mm to defer flush icache all") Fixes:0679d29d3e("csky: fix syscache.c fallthrough warning") Acked-by: Randy Dunlap <rdunlap@infradead.org> Co-Developed-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3483e1a41c
commit
b6a41435c8
|
|
@ -12,15 +12,17 @@ SYSCALL_DEFINE3(cacheflush,
|
||||||
int, cache)
|
int, cache)
|
||||||
{
|
{
|
||||||
switch (cache) {
|
switch (cache) {
|
||||||
case ICACHE:
|
|
||||||
case BCACHE:
|
case BCACHE:
|
||||||
flush_icache_mm_range(current->mm,
|
|
||||||
(unsigned long)addr,
|
|
||||||
(unsigned long)addr + bytes);
|
|
||||||
fallthrough;
|
|
||||||
case DCACHE:
|
case DCACHE:
|
||||||
dcache_wb_range((unsigned long)addr,
|
dcache_wb_range((unsigned long)addr,
|
||||||
(unsigned long)addr + bytes);
|
(unsigned long)addr + bytes);
|
||||||
|
if (cache != BCACHE)
|
||||||
|
break;
|
||||||
|
fallthrough;
|
||||||
|
case ICACHE:
|
||||||
|
flush_icache_mm_range(current->mm,
|
||||||
|
(unsigned long)addr,
|
||||||
|
(unsigned long)addr + bytes);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user