Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9745034rwl; Wed, 11 Jan 2023 09:22:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXvWeToibVhn2Zl3aee2XyJsVnMDl40y0Z5djWN/vi11LwOCRaLaWJiL47wYeHpAFjjofSxc X-Received: by 2002:a05:6a20:4929:b0:a3:218a:c761 with SMTP id ft41-20020a056a20492900b000a3218ac761mr72078285pzb.5.1673457773637; Wed, 11 Jan 2023 09:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673457773; cv=none; d=google.com; s=arc-20160816; b=pHpfFnDUGW+WegJ794hB5s0XFgJ/MOdBzfGOYSIgXfK67iaU36dGFmMHQI43m4Q70j oGk3f/yPpJdYWTQw29bb+oO6ZIC0SD4mgWN4s07rrYdfjnlNE0lM6DHKqAutSs8Kx2Wm waTl/jdkCpv2niPFSKKrqo79qZADNLTdGHTwxm2MUhxLjJ4j1TIdOmFv993UIxLxki33 n6G9G+D/2KpC6JSehwOeo8Zv+kVLtmhc775ZgeKj+9wt19E78Db/LyDNEGbaBNnULqI0 AJtjzvqgM/UwYrRWBAPrWAL0WBSfuE59IOUwnpjcSfVSPfGnsL05eSryNMXUuUHaXI6v UM7Q== 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=TwNSeOM/IzvM1fRNlG0dOPr/e8w+p2LZF4Q+AfhdzL32YbZ3pPCgEhsO3iH4rO90K7 hqTfHyJhlHNHzyn50oZpwniXXMQpCK57nRmv1t14erNou4pAQNYcnYP66XVuiknTk23F D+NVFdK0R4EH4dXEoBVueC1/pm/Cy9aY933zw8P7/USGVeJo3vPmsS5lQESk2r2dCs7H JUIKRJiyhIqIyXA5FvpYoHsW4pq6YFm/j2qi0vknZlzrs+W69l0Hbfa0tlWrRVQuDkIo cz6BuIjxAR32WOqinxtx4D+XeiUCO9rocTB6A2imkW0ysD1/cy+ELnxMc6ymwtJYyyxj yrng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E8P7e3Dg; 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 y73-20020a638a4c000000b004b818851b74si1411504pgd.53.2023.01.11.09.22.47; Wed, 11 Jan 2023 09:22:53 -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=E8P7e3Dg; 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 S236011AbjAKRVH (ORCPT + 51 others); Wed, 11 Jan 2023 12:21:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234665AbjAKRUy (ORCPT ); Wed, 11 Jan 2023 12:20:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECE1C214; Wed, 11 Jan 2023 09:20:51 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 82D3A61D9E; Wed, 11 Jan 2023 17:20:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B06EEC433D2; Wed, 11 Jan 2023 17:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673457650; bh=srRoyMhEcGCbVrLyfi/YwhTea+Yq+TgoCP9PTzDvRWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E8P7e3DgoRR0f4oVsM+IeXcbwq+Pqj2apye5Vlha8rab1w4XjqQnU9RjsHt9Il2HT 1l5sHlkLlVGjvYBulYoUKJwazR6wsDqPDSwbN8J9SLgy1UYo7pVch6Rm3IuBr2itiS d/7dfcPo1RDjT73MkOeGwINvd3XOHxbUZAZRQQPg/en1zdBbQefOoNjGD57CBsubS9 DGwO1N5+tWkIwRzUHgqJhTcy4Rma0Z7xjiwE7HjqDDIdVdd3K+cNwUU3xpLcqdHj6p 8fqp1VpToe81uoDdi2ZqRZQiL91Heaqoe0l1mEMnE9JBg2E2kuDUKytBfyvdm/fHbJ ZhisnXHbdLewA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Andrew Jones , Conor Dooley Subject: [PATCH v3 02/13] riscv: move riscv_noncoherent_supported() out of ZICBOM probe Date: Thu, 12 Jan 2023 01:10:16 +0800 Message-Id: <20230111171027.2392-3-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111171027.2392-1-jszhang@kernel.org> References: <20230111171027.2392-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