* [PATCH] power: reset: at91: mark at91_wakeup_status non-__init
@ 2023-12-12 21:46 Arnd Bergmann
2023-12-12 21:50 ` Nathan Chancellor
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2023-12-12 21:46 UTC (permalink / raw)
To: Sebastian Reichel, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Nathan Chancellor, Uwe Kleine-König
Cc: Arnd Bergmann, Nick Desaulniers, Bill Wendling, Justin Stitt,
Yangtao Li, linux-pm, linux-arm-kernel, linux-kernel, llvm
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(-)
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] power: reset: at91: mark at91_wakeup_status non-__init
2023-12-12 21:46 [PATCH] power: reset: at91: mark at91_wakeup_status non-__init Arnd Bergmann
@ 2023-12-12 21:50 ` Nathan Chancellor
2023-12-13 7:25 ` Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2023-12-12 21:50 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sebastian Reichel, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Uwe Kleine-König, Arnd Bergmann,
Nick Desaulniers, Bill Wendling, Justin Stitt, Yangtao Li,
linux-pm, linux-arm-kernel, linux-kernel, llvm
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
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] power: reset: at91: mark at91_wakeup_status non-__init
2023-12-12 21:50 ` Nathan Chancellor
@ 2023-12-13 7:25 ` Uwe Kleine-König
2023-12-13 13:01 ` Nicolas Ferre
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2023-12-13 7:25 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Arnd Bergmann, Sebastian Reichel, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Arnd Bergmann,
Nick Desaulniers, Bill Wendling, Yangtao Li, linux-pm,
linux-arm-kernel, linux-kernel, llvm
[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]
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
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] power: reset: at91: mark at91_wakeup_status non-__init
2023-12-13 7:25 ` Uwe Kleine-König
@ 2023-12-13 13:01 ` Nicolas Ferre
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2023-12-13 13:01 UTC (permalink / raw)
To: Uwe Kleine-König, Nathan Chancellor, Sebastian Reichel
Cc: Arnd Bergmann, Alexandre Belloni, Claudiu Beznea, Arnd Bergmann,
Nick Desaulniers, Bill Wendling, Yangtao Li, linux-pm,
linux-arm-kernel, linux-kernel, llvm
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-13 13:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12 21:46 [PATCH] power: reset: at91: mark at91_wakeup_status non-__init Arnd Bergmann
2023-12-12 21:50 ` Nathan Chancellor
2023-12-13 7:25 ` Uwe Kleine-König
2023-12-13 13:01 ` Nicolas Ferre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).