From nobody Tue Dec 16 11:50:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 153D7C0032E for ; Thu, 26 Oct 2023 02:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbjJZCCb (ORCPT ); Wed, 25 Oct 2023 22:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjJZCCa (ORCPT ); Wed, 25 Oct 2023 22:02:30 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 25 Oct 2023 19:02:27 PDT Received: from outboundhk.mxmail.xiaomi.com (outboundhk.mxmail.xiaomi.com [118.143.206.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D05A116 for ; Wed, 25 Oct 2023 19:02:27 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.03,252,1694707200"; d="scan'208";a="68935568" From: Fang Xiang To: , , , CC: Subject: [PATCH] irqchip/gic-v3-its: Fix the coherent issue in its_setup_baser() when shr = 0. Date: Thu, 26 Oct 2023 10:01:16 +0800 Message-ID: <20231026020116.4238-1-fangxiang3@xiaomi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.237.8.18] X-ClientProxiedBy: BJ-MBX02.mioffice.cn (10.237.8.122) To BJ-MBX15.mioffice.cn (10.237.8.135) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The table would not be flushed if the input parameter shr =3D 0 in its_setu= p_baser() and it would cause a coherent problem. Signed-off-by: Fang Xiang --- drivers/irqchip/irq-gic-v3-its.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index 75a2dd550625..58a9f24ccfa7 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -2394,13 +2394,15 @@ static int its_setup_baser(struct its_node *its, st= ruct its_baser *baser, * non-cacheable as well. */ shr =3D tmp & GITS_BASER_SHAREABILITY_MASK; - if (!shr) { + if (!shr) cache =3D GITS_BASER_nC; - gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); - } + goto retry_baser; } =20 + if (!shr) + gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); + if (val !=3D tmp) { pr_err("ITS@%pa: %s doesn't stick: %llx %llx\n", &its->phys_base, its_base_type_string[type], --=20 2.34.1