Patch "csky: syscache: Fixup duplicate cache flush" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    csky: syscache: Fixup duplicate cache flush

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     csky-syscache-fixup-duplicate-cache-flush.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a86087600360eeb2ef796ccf002a905e2ee48245
Author: Guo Ren <guoren@xxxxxxxxxxxxxxxxx>
Date:   Tue May 4 14:08:44 2021 +0800

    csky: syscache: Fixup duplicate cache flush
    
    [ Upstream commit 6ea42c84f33368eb3fe1ec1bff8d7cb1a5c7b07a ]
    
    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: 997153b9a75c ("csky: Add flush_icache_mm to defer flush icache all")
    Fixes: 0679d29d3e23 ("csky: fix syscache.c fallthrough warning")
    Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Co-Developed-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Signed-off-by: Guo Ren <guoren@xxxxxxxxxxxxxxxxx>
    Cc: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/csky/mm/syscache.c b/arch/csky/mm/syscache.c
index 4e51d63850c4..cd847ad62c7e 100644
--- a/arch/csky/mm/syscache.c
+++ b/arch/csky/mm/syscache.c
@@ -12,15 +12,17 @@ SYSCALL_DEFINE3(cacheflush,
 		int, cache)
 {
 	switch (cache) {
-	case ICACHE:
 	case BCACHE:
-		flush_icache_mm_range(current->mm,
-				(unsigned long)addr,
-				(unsigned long)addr + bytes);
-		fallthrough;
 	case DCACHE:
 		dcache_wb_range((unsigned long)addr,
 				(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;
 	default:
 		return -EINVAL;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux