Message ID | 20231212214658.213510-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp8021517vqy; Tue, 12 Dec 2023 13:47:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3xdkZ0teHOC/F+LsNZIRcr5TWDEWAprP/FJFKvIgYS87FBz3+sFoLS+qI5bD1rkdsLqtR X-Received: by 2002:a05:6a20:ba84:b0:18f:aa4:9c23 with SMTP id fb4-20020a056a20ba8400b0018f0aa49c23mr6777924pzb.62.1702417636797; Tue, 12 Dec 2023 13:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702417636; cv=none; d=google.com; s=arc-20160816; b=Dymg/7raOTv2ZLy0lJaxlqRnM+HAi509oiOS7ELFpAPZc0H5IBmCqF0PeRaKVgt9W6 Q9ojZ0QtHk0bCScex0v0b6nQwvLDUPiyat5n59469SdTiXD2KLzrpS6KzLWXOv0wTgLU VuPUaw1vgPxOm42pVssNoP6kEvVI0uy7GmFXlRNoyvDKGls+Oc0A9H5PPTYfS3FIqx9Q AtRuac80vamdoysz1GwX9tn0KrcIAuA/JUsb9kKw8wQxGznavPLy21jNKidLyhsjvoeb fXj77e45LEWwMPWKINOOIHbd6xcXxCmf9zztcXpP02SCrvIaaXh+XyHzx/zBzj96ortk JLBg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HLn7mgpL3a91MBd10+RVXFtbeOExgBggkTGolEDUWz0=; fh=ihV95EGQZHTeLCrHixA2xGpLZfSI7OXKcPTASJMGKAg=; b=TgNkOR1Tcuwcavqcdy4hFlU6hjYeq/j4Y5Rg4A2V1W1cevCC6PIff5ycTOFp7+xzpN Y/vaf7WlxToBF1urgounqKkj8Gbii3UIrDw4hIhVn+PJayNSKjVTAwTyJnogEPfXu7ZT dwHFf5SOnnUCHKOIobVHilL+wPBTRw62BRid9MbYD8J29ikHd3FOLZnq7eCNCgHSHhM1 1ScvbtLtnjC6NyEP+MV0GF1epu7GfpjXidk+JzHp8qS6hzrBQGoXnt6cWcJZICj8NLmC oOvVGYoZsLXoMSm0p0Jw7xkLIZL0xIMnkfICLEDPJSD2p+p5pzDc1ZJvT/BFlAgscOQl cnyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=raybKYX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id jc31-20020a056a006c9f00b006cded1e8135si8244483pfb.197.2023.12.12.13.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 13:47:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=raybKYX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9F5CE804C571; Tue, 12 Dec 2023 13:47:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235173AbjLLVrA (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Tue, 12 Dec 2023 16:47:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235162AbjLLVq6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 12 Dec 2023 16:46:58 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450EAB9 for <linux-kernel@vger.kernel.org>; Tue, 12 Dec 2023 13:47:05 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4C01C433C7; Tue, 12 Dec 2023 21:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702417624; bh=GEbphLNtH08LYd0Afzr3nGiRgbiKfgbz66e9KqMpUhU=; h=From:To:Cc:Subject:Date:From; b=raybKYX8pD28eWvS9kJTUl17VqcRAmZWstq0aEf1C5YsyMLoc/U6BK4UMr4to8xgu Py/EVmYq86jMuQpfTSQrmFfU0X10fGjEVGaklTTf4buECe/CUdzkkYlAJAjNdoyNrt amBFsljgtiA0eQQQKmFzf/W+n+ILhvvBUUBTNazhzkjSnnxCHnGTXqnuUXaf+M+znV y0Z39pyNU1P+BdG9XIzmUUjYufwwvnAaT8yYxL5Vtps3Omv25TLyRfLvuEr2OE9gNS R+eOyk6olNvcyMhMsioZHrRdYAhvLmPEeGTMhc2vGQ3HSjPkaVbWeztI2suV8rejIY ITWUOrZ8Vc+aA== From: Arnd Bergmann <arnd@kernel.org> To: Sebastian Reichel <sre@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@tuxon.dev>, Nathan Chancellor <nathan@kernel.org>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> Cc: Arnd Bergmann <arnd@arndb.de>, Nick Desaulniers <ndesaulniers@google.com>, Bill Wendling <morbo@google.com>, Justin Stitt <justinstitt@google.com>, Yangtao Li <frank.li@vivo.com>, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] power: reset: at91: mark at91_wakeup_status non-__init Date: Tue, 12 Dec 2023 22:46:49 +0100 Message-Id: <20231212214658.213510-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 13:47:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785114275570701541 X-GMAIL-MSGID: 1785114275570701541 |
Series |
power: reset: at91: mark at91_wakeup_status non-__init
|
|
Commit Message
Arnd Bergmann
Dec. 12, 2023, 9:46 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de> --- drivers/power/reset/at91-poweroff.c | 2 +- drivers/power/reset/at91-sama5d2_shdwc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Tue, Dec 12, 2023 at 10:46:49PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > 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 <arnd@arndb.de> 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 <nathan@kernel.org> > --- > 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 > >
Hello, [dropped Justin Stitt from Cc, their email address bounced for me in the past] On Tue, Dec 12, 2023 at 02:50:02PM -0700, Nathan Chancellor wrote: > On Tue, Dec 12, 2023 at 10:46:49PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann <arnd@arndb.de> > > > > 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 <arnd@arndb.de> > > 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 <nathan@kernel.org> I don't care either. Given the change is identical (Nathan's submission even has "index 126e774e210c..93eece027865 100644" which exactly matches Arnd's patch), I'll forward my Reviewed-by: tag to here: Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Thanks Uwe
On 13/12/2023 at 08:25, Uwe Kleine-König wrote: > On Tue, Dec 12, 2023 at 02:50:02PM -0700, Nathan Chancellor wrote: >> On Tue, Dec 12, 2023 at 10:46:49PM +0100, Arnd Bergmann wrote: >>> From: Arnd Bergmann<arnd@arndb.de> >>> >>> 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<arnd@arndb.de> >> 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<nathan@kernel.org> > I don't care either. Given the change is identical (Nathan's submission > even has "index 126e774e210c..93eece027865 100644" which exactly matches > Arnd's patch), I'll forward my Reviewed-by: tag to here: > > Reviewed-by: Uwe Kleine-König<u.kleine-koenig@pengutronix.de> Likewise: Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Use whichever is preferred. Regards, Nicolas
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;