ARM: tegra: make tegra_cpu_reset_handler_enable() __init
Subsystems (3)
PATCH 1/1 ARM: tegra: make tegra_cpu_reset_handler_enable() __init
From: Stephen Warren <[email protected]>
This solves a section mismatch warning. I hadn't noticed this before, because my compiler was inlining tegra_cpu_reset_handler_enable() inside tegra_cpu_reset_handler_init(), which is already __init, but I switched compilers and it stopped doing that.
---
Arnd, Olof, do you want me to put this in a pull request, or can you apply it directly for 3.5?
arch/arm/mach-tegra/reset.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-tegra/reset.c +1 -1
@@ -33,7 +33,7 @@static bool is_enabled; -static void tegra_cpu_reset_handler_enable (void ) +static void __init tegra_cpu_reset_handler_enable (void ) {void __iomem *iram_base =IO_ADDRESS (TEGRA_IRAM_RESET_BASE ); void __iomem *evp_cpu_reset =
Signature · 1 line
1.7.0.4
Olof Johansson
AppliedPATCH 1/1 ARM: tegra: make tegra_cpu_reset_handler_enable() __init
Quoted 7 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This solves a section mismatch warning. I hadn't noticed this before, because my compiler was inlining
tegra_cpu_reset_handler_enable()insidetegra_cpu_reset_handler_init(), which is already__init, but I switched compilers and it stopped doing that.
Quoted 5 lines
Cc <[email protected]> # v3.4Signed-off-by Stephen Warren <[email protected]>---
Arnd, Olof, do you want me to put this in a pull request, or can you apply it directly for 3.5?
Single patches are just fine as is, no need for a pull request.
Applied to fixes. Thanks!
-Olof
PATCH 1/1 ARM: tegra: make tegra_cpu_reset_handler_enable() __init
In reply to Stephen WarrenQuoted 6 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This solves a section mismatch warning. I hadn't noticed this before, because my compiler was inlining
tegra_cpu_reset_handler_enable()insidetegra_cpu_reset_handler_init(), which is already__init, but I switched compilers and it stopped doing that.
Why does this generate a section mismatch warning? I see why calling a a __init marked function from a non __init marked function is a problem, but the opposite should be ok no?
Cheers,
Peter.
PATCH 1/1 ARM: tegra: make tegra_cpu_reset_handler_enable() __init
Quoted 11 lines · Peter De Schrijver
Quoted 6 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This solves a section mismatch warning. I hadn't noticed this before, because my compiler was inlining
tegra_cpu_reset_handler_enable()insidetegra_cpu_reset_handler_init(), which is already__init, but I switched compilers and it stopped doing that.Why does this generate a section mismatch warning? I see why calling a a
__initmarked function from a non__initmarked function is a problem, but the opposite should be ok no?
The issue is that tegra_cpu_reset_handler_enable() itself (which was not __init but the patch made to be __init) was referencing variable __tegra_cpu_reset_handler_{start,end}. This wasn't noticed before because when tegra_cpu_reset_handler_enable() was inlined into tegra_cpu_reset_handler_init(), tegra_cpu_reset_handler_enable() was effectively __init. However, when built as a separate function, you ended up with a non-__init function referencing other things that were __init.
In other words, this is indeed nothing to do with __init function tegra_cpu_reset_handler_init() calling non-__init function tegra_cpu_reset_handler_enable().
You can get the details by reverting the patch and building:-)
PATCH 1/1 ARM: tegra: make tegra_cpu_reset_handler_enable() __init
Quoted 22 lines · Stephen Warren
Quoted 11 lines · Peter De Schrijver
Quoted 6 lines · Stephen Warren
From: Stephen Warren <[email protected]>
This solves a section mismatch warning. I hadn't noticed this before, because my compiler was inlining
tegra_cpu_reset_handler_enable()insidetegra_cpu_reset_handler_init(), which is already__init, but I switched compilers and it stopped doing that.Why does this generate a section mismatch warning? I see why calling a a
__initmarked function from a non__initmarked function is a problem, but the opposite should be ok no?The issue is that
tegra_cpu_reset_handler_enable()itself (which was not__initbut the patch made to be__init) was referencing variable __tegra_cpu_reset_handler_{start,end}. This wasn't noticed before because whentegra_cpu_reset_handler_enable()was inlined intotegra_cpu_reset_handler_init(),tegra_cpu_reset_handler_enable()was effectively__init. However, when built as a separate function, you ended up with a non-__init function referencing other things that were__init.
Quoted 3 lines
In other words, this is indeed nothing to do with
__initfunctiontegra_cpu_reset_handler_init()calling non-__init functiontegra_cpu_reset_handler_enable().
Ah. That makes sense :) We need to be careful with this when introducing system suspend support because some of this work needs to be redone on resume.
Cheers,
Peter.