From bc0263dea7e284d67e4bbe97db3f226d353f4d39 Mon Sep 17 00:00:00 2001
From: XiaoDong Huang <derrick.huang@rock-chips.com>
Date: Mon, 11 Jan 2021 19:51:18 +0800
Subject: [PATCH] irqchip/gic-v3-its: flush base table if rk356x

Change-Id: Ia2b0dd3d47742c43939eb99d3f8adac8e1107603
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2385,8 +2385,12 @@ retry_baser:
 	tmp = baser->val;
 
 	if (of_machine_is_compatible("rockchip,rk3568") ||
-	    of_machine_is_compatible("rockchip,rk3566"))
-		tmp &= ~GITS_BASER_SHAREABILITY_MASK;
+	    of_machine_is_compatible("rockchip,rk3566")) {
+		if (tmp & GITS_BASER_SHAREABILITY_MASK)
+			tmp &= ~GITS_BASER_SHAREABILITY_MASK;
+		else
+			gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order));
+	}
 
 	if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
 		/*
