power: reset: at91: mark at91_wakeup_status non-__init
Subsystems (3)
PATCH 1/1 power: reset: at91: mark at91_wakeup_status non-__init
From: Arnd Bergmann <[email protected]>
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.
--- drivers/power/reset/at91-poweroff.c | 2 +- drivers/power/reset/at91-sama5d2_shdwc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/power/reset/at91-poweroff.c +1 -1
@@ -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 );
drivers/power/reset/at91-sama5d2_shdwc.c +1 -1
@@ -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;
Signature · 1 line
2.39.2
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Two copies of the
at91_wakeup_status()function are called by the respectiveprobe()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:
Quoted 8 lines
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 <[email protected]>
Thanks, I sent the same change three weeks ago at this point:
https://lore.kernel.org/[email protected]/
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...
Quoted 35 lines
--- drivers/power/reset/at91-poweroff.c | 2 +- drivers/power/reset/at91-sama5d2_shdwc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/power/reset/at91-poweroff.c +1
-1@@ -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 );drivers/power/reset/at91-sama5d2_shdwc.c +1
-1@@ -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;Signature · 1 line
2.39.2
Uwe Kleine-König
Reviewed-byHello,
[dropped Justin Stitt from Cc, their email address bounced for me in the past]
Quoted 20 lines · Nathan Chancellor
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Two copies of the
at91_wakeup_status()function are called by the respectiveprobe()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:Quoted 8 lines
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 <[email protected]>Thanks, I sent the same change three weeks ago at this point:
Quoted 7 lines
https://lore.kernel.org/[email protected]/
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 <[email protected]>
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:
Thanks
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Quoted 26 lines · Uwe Kleine-König
Quoted 25 lines · Nathan Chancellor
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann<[email protected]>
Two copies of the
at91_wakeup_status()function are called by the respectiveprobe()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:Quoted 8 lines
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<[email protected]>Thanks, I sent the same change three weeks ago at this point:
https://lore.kernel.org/[email protected]/
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...
Quoted 6 lines
Quoted 1 line
Reviewed-by Nathan Chancellor<[email protected]>I don't care either. Given the change is identical (Nathan's submission even has "index
126e774e210c..93eece027865100644" which exactly matches Arnd's patch), I'll forward my Reviewed-by: tag to here:Reviewed-by Uwe Kleine-König<[email protected]>
Likewise:
Use whichever is preferred.
Regards,
Nicolas