Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2096674rwb; Sun, 15 Jan 2023 09:08:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXt/1rpaJup9EreTDlghLgonfeeN1PU7QJYPcDzwZxlU/cRNndTJaRwcaV3QKNiX1pzYDusR X-Received: by 2002:a17:907:674e:b0:7c1:92b2:fa9e with SMTP id qm14-20020a170907674e00b007c192b2fa9emr80609237ejc.59.1673802490602; Sun, 15 Jan 2023 09:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673802490; cv=none; d=google.com; s=arc-20160816; b=m3YWp4+HY8jAOW0gLJYFNs+fU3ivMGIHo8pEtdepZyNP/R2ODeRi4DVFzcK5oHlsjF Rv+xF4am9pd0zWyfdC0JuHDenRsw7LP/SL4I1nHzQgp7EvKl0QrLK+M9SmPktEyAaD6E DpSLV1tTUjX14FX5D8iO6+RLpLDfoFi8PDq097XNizJIKHxVrpN8HWHdLpWZgxaiuEGL Ruz9pPCva+fsDS2M5XOWnRghnrcAtX+eYIhJLSHZUtRmjv+Cj4YNngRxX4a/jYssiCPK zs/DsoURaSClSfpIOUlR2x1EowwsGVlZOvz/N4m6cz37wUHnWQQUk2zNudVQQRDJakmV YfXw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yAvcB70EYqOz4OqS5ERDNweBnyVm6Xuw/WSe3Ligxps=; b=XA/+2tCk0Q53bg4UlZ6pZoBUNnRQDf1nrvXi37m1thx71N/onrCVIjYtEs9Z5dW4S3 AEmI5kNj3URZNcrMrybUpQBVvVZ3HU2v1PqtpOI/4JHytuz8keBxLwMa/fGtz1O+YIK5 5lLyX/jY03O9aV6inLde4T1kSPQL3XqBIQgIDZaJSUs0/s267ZhNu+fuWNNIaQuAZ1AB lfyTx/e046NDFrEB8Izgo9Nn+27gIBRH1EA6dXtnR7i29cw7qIpzK1OEppyT49/QXGO1 kO1Cp7SN/PnUewqeeu8YFz5VMuRWIPtGgjFKLEffvdhdPoHlFdk4D5RgwE5MeGKIrfaC ptBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MpnGDQ04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js10-20020a17090797ca00b007ae74740f93si32339815ejc.832.2023.01.15.09.07.58; Sun, 15 Jan 2023 09:08:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MpnGDQ04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231276AbjAOQAb (ORCPT + 52 others); Sun, 15 Jan 2023 11:00:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbjAOQAV (ORCPT ); Sun, 15 Jan 2023 11:00:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0DEFEC6F; Sun, 15 Jan 2023 08:00:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 51B9EB80B57; Sun, 15 Jan 2023 16:00:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B1EEC43398; Sun, 15 Jan 2023 16:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673798418; bh=srRoyMhEcGCbVrLyfi/YwhTea+Yq+TgoCP9PTzDvRWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpnGDQ04OAxYVgyGtooAbRxxt9PEeVpXwJPSRQ2liEurc7alZEU6/rrEi50L61iYv rfXDcIptC//n941IIJt1VhadgTLQsDDAfC/gxheWbaLymMxUwiRnhrvp9pxlfuQ7rv aQ4y/v+HH3G2hgcOZe/v4U2w//obZFm0TnPtLPwcLuqWPqKwPz3jfuJC/4ugAksm6L OfYVe3TarbXuIR+nosCvr68n60AbEf5IWLIfc/rSqSSBn8quIhjFMeGGUpHfrapveG 2YJ0vutmWaQiC0EKiluwuesm3vV7SctyENxAhK9BJ2ymcooEJMpIRFZ5NGkGWhWnWf LDxLFwXyF9fWg== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner , Conor Dooley , Andrew Jones Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH v4 02/13] riscv: move riscv_noncoherent_supported() out of ZICBOM probe Date: Sun, 15 Jan 2023 23:49:42 +0800 Message-Id: <20230115154953.831-3-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230115154953.831-1-jszhang@kernel.org> References: <20230115154953.831-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's a bit weird to call riscv_noncoherent_supported() each time when insmoding a module. Move the calling out of feature patch func. Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley --- arch/riscv/kernel/cpufeature.c | 1 - arch/riscv/kernel/setup.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 205bbd6b1fce..421b3d9578cc 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -297,7 +297,6 @@ static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage) if (!riscv_isa_extension_available(NULL, ZICBOM)) return false; - riscv_noncoherent_supported(); return true; } diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 86acd690d529..376d2827e736 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -300,6 +300,9 @@ void __init setup_arch(char **cmdline_p) riscv_init_cbom_blocksize(); riscv_fill_hwcap(); apply_boot_alternatives(); + if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) && + riscv_isa_extension_available(NULL, ZICBOM)) + riscv_noncoherent_supported(); } static int __init topology_init(void) -- 2.38.1