From patchwork Sat Apr 29 04:35:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 13226920 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41ED2C77B60 for ; Sat, 29 Apr 2023 04:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KhbWF+C+58HecYFdCLgrie/Q5Av4xaEWSPyhPYzRpTw=; b=nBRxImlgBDQVUF Y+FKxNPK6UrBqTiDyWaL/fnbPOIItagLy7x8U/KdW37/oLHcSZhT5SDU/wPDNWZGI/i4P/9sSGpw/ Z2v7QaIc6tgDHkAUqasI34qx75+f8DAVaeX1QHzsLov6YWABbRrlPP6YF5mYVIYk8K6jzjjUbhJim 3mgE3knCsXgDHKjNEtPGZASeSo9vqZM31+Y8sSeCJIKrLbv2n1HmujUXEbIfLIrZgTDwNOc8JG8EX PGQ8u4r8/NDC6HF+LC69UqIs9Is5VrqaiXboT/HCeHgbZbM2V+TTmRPiki5lSpnPnYxESd/F6Quyi ToACHCnWLzuVUYwGpDlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pscJ3-00CE9h-2Y; Sat, 29 Apr 2023 04:35:33 +0000 Received: from [2601:1c2:980:9ec0::2764] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pscJ0-00CE8t-2g; Sat, 29 Apr 2023 04:35:30 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Heiko Stuebner , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Subject: [PATCH] riscv: fix sifive and thead section mismatches in errata Date: Fri, 28 Apr 2023 21:35:30 -0700 Message-Id: <20230429043530.20503-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org When CONFIG_MODULES is set, __init_or_module becomes , but when CONFIG_MODULES is not set, __init_or_module becomes __init. In the latter case, it causes section mismatch warnings: WARNING: modpost: vmlinux.o: section mismatch in reference: riscv_fill_cpu_mfr_info (section: .text) -> sifive_errata_patch_func (section: .init.text) WARNING: modpost: vmlinux.o: section mismatch in reference: riscv_fill_cpu_mfr_info (section: .text) -> thead_errata_patch_func (section: .init.text) It appears that CONFIG_MODULES not set is not tested very much. Fixes: a8e910168bba ("riscv: implement module alternatives") Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head") Signed-off-by: Randy Dunlap Cc: Heiko Stuebner Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org --- arch/riscv/errata/sifive/errata.c | 8 +++----- arch/riscv/errata/thead/errata.c | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff -- a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c --- a/arch/riscv/errata/sifive/errata.c +++ b/arch/riscv/errata/sifive/errata.c @@ -82,11 +82,9 @@ static void __init_or_module warn_miss_e pr_warn("----------------------------------------------------------------\n"); } -void __init_or_module sifive_errata_patch_func(struct alt_entry *begin, - struct alt_entry *end, - unsigned long archid, - unsigned long impid, - unsigned int stage) +void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, + unsigned long archid, unsigned long impid, + unsigned int stage) { struct alt_entry *alt; u32 cpu_req_errata; diff -- a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c --- a/arch/riscv/errata/thead/errata.c +++ b/arch/riscv/errata/thead/errata.c @@ -83,9 +83,9 @@ static u32 thead_errata_probe(unsigned i return cpu_req_errata; } -void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, - unsigned long archid, unsigned long impid, - unsigned int stage) +void thead_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, + unsigned long archid, unsigned long impid, + unsigned int stage) { struct alt_entry *alt; u32 cpu_req_errata = thead_errata_probe(stage, archid, impid);