Procházet zdrojové kódy

platform: generic: starfive: Issue fence instruction out of the loop

This patch shifts the fence instruction outside of the loop in
sbi_dubhe_L2_inv_range and sbi_dubhe_L2_flush_range. Fence should
only be called once at the beginning and once at the end of the flush
or invalidate operation

Signed-off-by: Genevieve Chan <genevieve.chan@starfivetech.com>
Genevieve Chan před 1 rokem
rodič
revize
ff985349fd
1 změnil soubory, kde provedl 5 přidání a 4 odebrání
  1. 5 4
      platform/generic/starfive/dubhe_cache.S

+ 5 - 4
platform/generic/starfive/dubhe_cache.S

@@ -27,14 +27,15 @@ __sbi_dubhe_L2_inv_range:
 	add	a1, a1, a0	/* Compute end address */
 	not	t2, t1
 	and	a0, a0, t2
+	fence	rw, rw
 1:
 	/* CDISCARD.L2 rs1 = a0 */
-	fence	rw, rw
 	.insn i 0x73, 0, x0, a0, -0x3A
-	fence	rw, rw
+
 	add	a0, a0, t0
 	blt	a0, a1, 1b
 2:
+	fence	rw, rw
 	ret
 
 	/*
@@ -55,12 +56,12 @@ __sbi_dubhe_L2_flush_range:
 	add	a1, a1, a0	/* Compute end address */
 	not	t2, t1
 	and	a0, a0, t2
+	fence	rw, rw
 1:
 	/* CFLUSH.L2 rs1 = a0 */
-	fence	rw, rw
 	.insn i 0x73, 0, x0, a0, -0x3C
-	fence	rw, rw
 	add	a0, a0, t0
 	blt	a0, a1, 1b
 2:
+	fence	rw, rw
 	ret