From mboxrd@z Thu Jan 1 00:00:00 1970 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 02EFEC4332F for ; Tue, 12 Dec 2023 21:50:34 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o0qZ9Gy5J5QN5vlSsWVxWKHo0t7aIsuSKGHs6KULT+c=; b=ZM/lNSdr0y17i7 lNAW4sJPthrkm44H6NNm3UpKpJLXT7NrPQh6g7ArqeMVRn+Qm1axd3VDYa1R1Tm3tX46bMa+e2o/5 0M7ksa7jyfzI7zNdwdp0dMRp62meS8KM9cUPVysQEURi1RwjM2NA64wf267v6zeSO1rG9gDCqJd/i ZIesRo8Qs2XNS/sEU8dCPa64YisIt3i1mChYomqK0XlqJJXTOkJ1cqbH8/C0gsi7yA1qcRDMeaSiX 8PZ13v61UhtfC/oGzl0MV0nBy5ZtgkC9GgTh3MqgBeYTEQtOXl+InqX2CmUfmkxFktTmZENVE+QIt jsX22fqufpvlZFeSU5wA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDAdq-00Crap-0W; Tue, 12 Dec 2023 21:50:14 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDAdm-00CrZu-31 for linux-arm-kernel@lists.infradead.org; Tue, 12 Dec 2023 21:50:12 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 43599CE1C23; Tue, 12 Dec 2023 21:50:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9FF1C433C7; Tue, 12 Dec 2023 21:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702417805; bh=6ogrBXo4J5g4zBXsQOlW0y4FIDZEwSmJ8vaSdXm00eE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rzsvwnlo32fqTtf3/7LvOn0kX55GFA+RKbr8qR84zmtyBxBr8Z27rXb4U/6Pub9MR SZPALCeQvn2083UU6DzF9G7YUneqS+diLCLU8LotEsI+v9qPOxZhj11odGxvk5n6Iu yYJwm5kUuY6Vy6D9LYgAhKLUqWGU9OnXxgbB18lXh+hcvu9SPljiZMuBhOwujYPV8b x5LlP7Gs6hZTDH8OmivofNGvAtf7K8ZIEwfbXCbp83wdffTbNJmxqjofNZEOFXBNyK 0sZ4swf7yt8LFaX5CAqYXb07ZoIeMFPXObopMU3OU3jhLSRBwnsDhIjjrrajdlI1xP MnbKaOMp5BiWw== Date: Tue, 12 Dec 2023 14:50:02 -0700 From: Nathan Chancellor To: Arnd Bergmann Subject: Re: [PATCH] power: reset: at91: mark at91_wakeup_status non-__init Message-ID: <20231212215002.GA3300655@dev-arch.thelio-3990X> References: <20231212214658.213510-1-arnd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231212214658.213510-1-arnd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231212_135011_462612_208FB8EE X-CRM114-Status: GOOD ( 22.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Justin Stitt , Arnd Bergmann , Yangtao Li , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Nick Desaulniers , Claudiu Beznea , Sebastian Reichel , Bill Wendling , llvm@lists.linux.dev, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 12, 2023 at 10:46:49PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Two copies of the at91_wakeup_status() function are called by the > respective probe() callbacks and are marked __init, but the probe > functions are no longer annotated that way. This works with gcc because > the functions always get inlined, but clang keeps them separate, which > can lead to executing freed memory: > > WARNING: modpost: vmlinux: section mismatch in reference: at91_poweroff_probe+0x80 (section: .text) -> at91_wakeup_status (section: .init.text) > WARNING: modpost: vmlinux: section mismatch in reference: at91_shdwc_probe+0xcc (section: .text) -> at91_wakeup_status (section: .init.text) > > Drop the incorrect annotation on these. > > Fixes: 099806de68b7 ("power: reset: at91-poweroff: Stop using module_platform_driver_probe()") > Fixes: dde74a5de817 ("power: reset: at91-sama5d2_shdwc: Stop using module_platform_driver_probe()") > Signed-off-by: Arnd Bergmann Thanks, I sent the same change three weeks ago at this point: https://lore.kernel.org/20231120-fix-at91-modpost-warnings-v1-1-813671933863@kernel.org/ Your commit message is a little better than mine and I don't really care which one goes in but it would be good if this could get cleared up soon... Reviewed-by: Nathan Chancellor > --- > drivers/power/reset/at91-poweroff.c | 2 +- > drivers/power/reset/at91-sama5d2_shdwc.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c > index 126e774e210c..93eece027865 100644 > --- a/drivers/power/reset/at91-poweroff.c > +++ b/drivers/power/reset/at91-poweroff.c > @@ -57,7 +57,7 @@ static struct shdwc { > void __iomem *mpddrc_base; > } at91_shdwc; > > -static void __init at91_wakeup_status(struct platform_device *pdev) > +static void at91_wakeup_status(struct platform_device *pdev) > { > const char *reason; > u32 reg = readl(at91_shdwc.shdwc_base + AT91_SHDW_SR); > diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c > index af95c7b39cb3..959ce0dbe91d 100644 > --- a/drivers/power/reset/at91-sama5d2_shdwc.c > +++ b/drivers/power/reset/at91-sama5d2_shdwc.c > @@ -107,7 +107,7 @@ static const unsigned long long sdwc_dbc_period[] = { > 0, 3, 32, 512, 4096, 32768, > }; > > -static void __init at91_wakeup_status(struct platform_device *pdev) > +static void at91_wakeup_status(struct platform_device *pdev) > { > struct shdwc *shdw = platform_get_drvdata(pdev); > const struct reg_config *rcfg = shdw->rcfg; > -- > 2.39.2 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel