Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp549845rwb; Thu, 6 Oct 2022 00:38:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Q/hoXSZ1bglXKcxSEBWiy86FRGd9n95f+0/H4ONBqRpyWrLcnMh6pH5tZysbYKmpW89K5 X-Received: by 2002:a17:906:cc56:b0:78b:cc87:2a39 with SMTP id mm22-20020a170906cc5600b0078bcc872a39mr2972692ejb.68.1665041906353; Thu, 06 Oct 2022 00:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665041906; cv=none; d=google.com; s=arc-20160816; b=kWFz5OrRjkT5/k8KbVcBKJYkFtA1tV1cu1J088yGOFTAz7Ygay82kQ3onyc2oKlxP2 e5bTS2uBxitM/69Vf0IX5k+/z43osFrY36w5I4wZjVF0uqDZxyHuCf+CEpP1DoXc+z7q bMHF/vvFFrKVvIegBXpu3rFOsax65rlR80hHRvrR6ZahSBybGW1N7iV6qUHjjKLwyB3e eoSWIAAaA6CHrFPg3qWkM8Gl/LdYIVdhCs3A4Cj8dakGoquq3VJ5R7k54p8Vw/ZkTEmL N6Q85KCd5VyYOBh/uFWq2sEl2RFPIgzQbRtVqeQsIIR64lytoA1+adiv1bNDGthrfoht nfbA== 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=HcW+0zQ2WjtuOTKTWjVNolzH6o2CJXAb5n6BUmHsysY=; b=rKk68vvZ2dyFU9lK89ilDomMl5XWKlOQ8OmnQB3xbOenz1s99r+FZeXb0c4uMyDGSf 3isEHC8DqtcYYpmAakeespBFx1ztOBIghxcW5pC1jR8N8Zz4IC8hbppBfYQtykBbTOyo ArELOLoFTZaRTLXxgQWr2LGxxzA7nXP92pmbUERAbrCER9jCcXxuY+Mx/dlYP6OwS4te isXtIWiBk0kOuuNK0jkQm2Ae136oV/KME88eihUB/d/KtWn6DwmK16cIpgbQUzCi9yR7 RP3iXTgJVXHsAKL5IVhka+a/armcroan9hq5M2bOj/j7pca7OGu+YC3zAkRECDwwgglE 3tMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1HVQJNx; 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 di12-20020a170906730c00b00780cb1272eesi15493677ejc.466.2022.10.06.00.38.01; Thu, 06 Oct 2022 00:38:26 -0700 (PDT) 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=t1HVQJNx; 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 S229610AbiJFHR6 (ORCPT + 99 others); Thu, 6 Oct 2022 03:17:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229987AbiJFHRx (ORCPT ); Thu, 6 Oct 2022 03:17:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184C14B986 for ; Thu, 6 Oct 2022 00:17:53 -0700 (PDT) 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 A3B2461861 for ; Thu, 6 Oct 2022 07:17:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9DEEC433D7; Thu, 6 Oct 2022 07:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665040672; bh=w9W7UBpVdspzCyp6qUSPQAQAXbvMYaSbMRYZmTO4oSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t1HVQJNxlNTNOXW0QK/oloZXr/BfPEYQmtRgt+XfD5WPHOtKRssM2aR3KVYJfEzOV xzRBv2NPcusfEyme5F8TuA/xyELvb7joEpSGuNMo7PnsUqt+FJSbL3vQpwrr7RJfjy jsw6d94M7lhEHj6hnuIHHx3EoFnt+qmIblM12CxDeGXF9vrPIBGJdKy9Fdnk/R2ep2 8hUX+H7r1d/zw91NxlqKgChRu0h+uPqmRy62YhYLIofwiCdFCrHeoxc371xNNFGqkS Mfurgm+G/9HtR55C3+E4BEQIHBMuiACaB5dMsWfEPelLDVpAUC4pwlYNULWa6cTXqo IQLqY9Y21g1TQ== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] riscv: move riscv_noncoherent_supported() out of ZICBOM probe Date: Thu, 6 Oct 2022 15:08:11 +0800 Message-Id: <20221006070818.3616-2-jszhang@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221006070818.3616-1-jszhang@kernel.org> References: <20221006070818.3616-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 wired to call riscv_noncoherent_supported() once when insmod a module. Move the calling out of feature patch func. Signed-off-by: Jisheng Zhang --- arch/riscv/kernel/cpufeature.c | 7 +------ arch/riscv/kernel/setup.c | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3b5583db9d80..03611b3ef45e 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -272,12 +272,7 @@ static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage) case RISCV_ALTERNATIVES_EARLY_BOOT: return false; default: - if (riscv_isa_extension_available(NULL, ZICBOM)) { - riscv_noncoherent_supported(); - return true; - } else { - return false; - } + return riscv_isa_extension_available(NULL, ZICBOM); } #endif diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 2dfc463b86bb..1a055c3f5d9d 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -299,6 +299,10 @@ void __init setup_arch(char **cmdline_p) riscv_init_cbom_blocksize(); riscv_fill_hwcap(); apply_boot_alternatives(); +#ifdef CONFIG_RISCV_DMA_NONCOHERENT + if (riscv_isa_extension_available(NULL, ZICBOM)) + riscv_noncoherent_supported(); +#endif } static int __init topology_init(void) -- 2.37.2