Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp124706rdh; Wed, 25 Oct 2023 19:02:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRkG1OVI3prbUelcOE9ztj7zX1MZQoLH+1WpizhSB/rF9323JxDs/4AdIT8ki7Uym5PvCz X-Received: by 2002:a05:690c:300e:b0:5a7:b819:648f with SMTP id ey14-20020a05690c300e00b005a7b819648fmr16277981ywb.4.1698285770928; Wed, 25 Oct 2023 19:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698285770; cv=none; d=google.com; s=arc-20160816; b=XMx/kgc88j1xFP8+iOCsZXtnKrQWOLuFez9xl5lmxxD+FDzIMv4Y3tPNVwlZVwMp/5 ZeKcjQHrZK/597lvgr1CrjimsxB9ydNijCGKpPPoIEx444rCKW9lDm2pCKe6rZZ5kjR+ B0Biter82EqgPRAr2K4sldFQVGnfdksDEFpth5xn+zMkpatP5Y9H8C7G8PLsQrGhYqm3 5PXCVqRz3JvoYYjYtUPopulgv+/Sg2hMRZlWkoTpf1E6fTeda/hMVjpdD8g+H44qXouJ fzV89/mHfgd33m/N4MgtX5D+8xR7y4rVeUR8TS8qZOpavAq0Afitqggj+L6EWrv25H2F 54iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Fdq9WKcBgVl1K1nHzDFWaNs+s+fnt1jiTaH+hDzFFBA=; fh=FCJaJr5Zz+vH7Pc7M04UxdhmSKwgUsIUuRWcQIFmTQs=; b=r7GV2kJ/F+r1PKBLywzFUL4a8zw8DwVldLmmQIQ7mwBJDssD0p+NEznljiMGVxXqRH 9xT9qr9SHNBeH3VmT0tXh0Cv79dMZJYoNrLJQgm8aZbWEnNeSsGgP3g/gkE2QQW48xVz qmERw/he0OeqvHRx0Ejf5SrIm/k8WIcnHjUWS5RKnJxGRd05bS7Xo2GDSTqoJjL4mUpf cxeSIfrJjniYxHLRZeqrcNoW8pvaIEnknb3yNcW5hgETKEB8vT+q0/BAPqekqYUvfQXD pO2Jt2dPmsuSzMY1UCJeBtBpQQA0kx0ID+RC5gCAI/NmCEjXRdQYN8o0HY81VMpgfjRN DK9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=xiaomi.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id n68-20020a0de447000000b0059f6a38775dsi12083872ywe.485.2023.10.25.19.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 19:02:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=xiaomi.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7926B80F9CB5; Wed, 25 Oct 2023 19:02:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230318AbjJZCCb (ORCPT + 99 others); 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: 7BIT Content-Type: text/plain; charset=US-ASCII 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) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 25 Oct 2023 19:02:48 -0700 (PDT) The table would not be flushed if the input parameter shr = 0 in its_setup_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, struct its_baser *baser, * non-cacheable as well. */ shr = tmp & GITS_BASER_SHAREABILITY_MASK; - if (!shr) { + if (!shr) cache = GITS_BASER_nC; - gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); - } + goto retry_baser; } + if (!shr) + gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); + if (val != tmp) { pr_err("ITS@%pa: %s doesn't stick: %llx %llx\n", &its->phys_base, its_base_type_string[type], -- 2.34.1