public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix section mismatch warning.
@ 2008-11-19 13:52 Sanjeev Premi
  2008-11-20  0:26 ` David Brownell
  0 siblings, 1 reply; 6+ messages in thread
From: Sanjeev Premi @ 2008-11-19 13:52 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

This warning is observed when building for OMAP3EVM with pm-20081106.

WARNING: vmlinux.o(.data+0x89d4): Section mismatch in reference from the variable omap3evm_twldata to the variable .init.data:generic3430_t2scripts_data
The variable omap3evm_twldata references
the variable __initdata generic3430_t2scripts_data
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index a72772f..65e0bdc 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -130,7 +130,7 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = {
 	.irq_line	= 1,
 };
 
-static struct twl4030_platform_data omap3evm_twldata = {
+static struct twl4030_platform_data __initdata omap3evm_twldata = {
 	.irq_base	= TWL4030_IRQ_BASE,
 	.irq_end	= TWL4030_IRQ_END,
 
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix section mismatch warning.
  2008-11-19 13:52 [PATCH] Fix section mismatch warning Sanjeev Premi
@ 2008-11-20  0:26 ` David Brownell
  2008-11-20 12:44   ` Premi, Sanjeev
  0 siblings, 1 reply; 6+ messages in thread
From: David Brownell @ 2008-11-20  0:26 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

I know that Beagle and Overo get the same warnings, so this
isn't really a sufficient fix...


On Wednesday 19 November 2008, Sanjeev Premi wrote:
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -130,7 +130,7 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = {
>         .irq_line       = 1,
>  };
>  
> -static struct twl4030_platform_data omap3evm_twldata = {
> +static struct twl4030_platform_data __initdata omap3evm_twldata = {

... and that's incorrect in any case, since that data is used
by probe() code that's doesn't sit in an init section.

I have the following in my patchset, currently disabled since
it conflicts with other patches.  And in any case, Beagle can't
reboot with these "generic" scripts for some TBD reason.

- Dave

================= CUT HERE
---
 arch/arm/mach-omap2/board-omap3beagle.c       |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c          |    2 +-
 arch/arm/mach-omap2/board-overo.c             |    2 +-
 arch/arm/mach-omap2/twl4030-generic-scripts.c |    3 +++
 arch/arm/mach-omap2/twl4030-generic-scripts.h |    5 +++++
 5 files changed, 11 insertions(+), 3 deletions(-)

--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -188,7 +188,7 @@ static struct twl4030_platform_data beag
 	/* platform_data for children goes here */
 	.usb		= &beagle_usb_data,
 	.gpio		= &beagle_gpio_data,
-	.power		= &generic3430_t2scripts_data,
+	.power		= GENERIC3430_T2SCRIPTS_DATA,
 };
 
 static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -140,7 +140,7 @@ static struct twl4030_platform_data omap
 	.keypad		= &omap3evm_kp_data,
 	.madc		= &omap3evm_madc_data,
 	.usb		= &omap3evm_usb_data,
-	.power		= &generic3430_t2scripts_data,
+	.power		= GENERIC3430_T2SCRIPTS_DATA,
 	.gpio		= &omap3evm_gpio_data,
 };
 
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -162,7 +162,7 @@ static struct twl4030_platform_data over
 	.irq_end	= TWL4030_IRQ_END,
 	.gpio		= &overo_gpio_data,
 	.usb		= &overo_usb_data,
-	.power		= &generic3430_t2scripts_data,
+	.power		= GENERIC3430_T2SCRIPTS_DATA,
 };
 
 static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
--- a/arch/arm/mach-omap2/twl4030-generic-scripts.c
+++ b/arch/arm/mach-omap2/twl4030-generic-scripts.c
@@ -23,6 +23,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#ifdef CONFIG_TWL4030_POWER
+
 #include <linux/kernel.h>
 #include <linux/device.h>
 #include <linux/init.h>
@@ -76,3 +78,4 @@ struct twl4030_power_data generic3430_t2
 };
 
 
+#endif /* CONFIG_TWL4030_POWER */
--- a/arch/arm/mach-omap2/twl4030-generic-scripts.h
+++ b/arch/arm/mach-omap2/twl4030-generic-scripts.h
@@ -3,6 +3,11 @@
 
 #include <linux/i2c/twl4030.h>
 
+#ifdef CONFIG_TWL4030_POWER
 extern struct twl4030_power_data generic3430_t2scripts_data;
+#define GENERIC3430_T2SCRIPTS_DATA &generic3430_t2scripts_data
+#else
+#define GENERIC3430_T2SCRIPTS_DATA NULL
+#endif /* CONFIG_TWL4030_POWER */
 
 #endif

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] Fix section mismatch warning.
  2008-11-20  0:26 ` David Brownell
@ 2008-11-20 12:44   ` Premi, Sanjeev
  2008-11-20 12:55     ` Felipe Balbi
  2008-11-20 13:41     ` David Brownell
  0 siblings, 2 replies; 6+ messages in thread
From: Premi, Sanjeev @ 2008-11-20 12:44 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-omap@vger.kernel.org


> -----Original Message-----
> From: David Brownell [mailto:david-b@pacbell.net] 
> Sent: Thursday, November 20, 2008 5:56 AM
> To: Premi, Sanjeev
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] Fix section mismatch warning.
> 
> I know that Beagle and Overo get the same warnings, so this 
> isn't really a sufficient fix...

Was trying to fix for EVM. Can extend to these boards once we have a fix.

> 
> On Wednesday 19 November 2008, Sanjeev Premi wrote:
> > --- a/arch/arm/mach-omap2/board-omap3evm.c
> > +++ b/arch/arm/mach-omap2/board-omap3evm.c
> > @@ -130,7 +130,7 @@ static struct twl4030_madc_platform_data 
> > omap3evm_madc_data = {
> >         .irq_line       = 1,
> >  };
> >  
> > -static struct twl4030_platform_data omap3evm_twldata = {
> > +static struct twl4030_platform_data __initdata omap3evm_twldata = {
> 
> ... and that's incorrect in any case, since that data is used 
> by probe() code that's doesn't sit in an init section.

Function probe() would be in __devinit. Changing __initdata to __devinit
would be fine for compilation. Do you see any issues with it?

BTW, I could not locate the definition of platform_driver for twl4030
to verify if probe() is indeed in __devinit.

> I have the following in my patchset, currently disabled since 
> it conflicts with other patches.  And in any case, Beagle 
> can't reboot with these "generic" scripts for some TBD reason.
> 
> - Dave
> 
> ================= CUT HERE
> ---
>  arch/arm/mach-omap2/board-omap3beagle.c       |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c          |    2 +-
>  arch/arm/mach-omap2/board-overo.c             |    2 +-
>  arch/arm/mach-omap2/twl4030-generic-scripts.c |    3 +++
>  arch/arm/mach-omap2/twl4030-generic-scripts.h |    5 +++++
>  5 files changed, 11 insertions(+), 3 deletions(-)
> 
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -188,7 +188,7 @@ static struct twl4030_platform_data beag
>  	/* platform_data for children goes here */
>  	.usb		= &beagle_usb_data,
>  	.gpio		= &beagle_gpio_data,
> -	.power		= &generic3430_t2scripts_data,
> +	.power		= GENERIC3430_T2SCRIPTS_DATA,
>  };
>  
>  static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -140,7 +140,7 @@ static struct twl4030_platform_data omap
>  	.keypad		= &omap3evm_kp_data,
>  	.madc		= &omap3evm_madc_data,
>  	.usb		= &omap3evm_usb_data,
> -	.power		= &generic3430_t2scripts_data,
> +	.power		= GENERIC3430_T2SCRIPTS_DATA,
>  	.gpio		= &omap3evm_gpio_data,
>  };
>  
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -162,7 +162,7 @@ static struct twl4030_platform_data over
>  	.irq_end	= TWL4030_IRQ_END,
>  	.gpio		= &overo_gpio_data,
>  	.usb		= &overo_usb_data,
> -	.power		= &generic3430_t2scripts_data,
> +	.power		= GENERIC3430_T2SCRIPTS_DATA,
>  };
>  
>  static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
> --- a/arch/arm/mach-omap2/twl4030-generic-scripts.c
> +++ b/arch/arm/mach-omap2/twl4030-generic-scripts.c
> @@ -23,6 +23,8 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  
> 02111-1307  USA
>   */
>  
> +#ifdef CONFIG_TWL4030_POWER
> +
>  #include <linux/kernel.h>
>  #include <linux/device.h>
>  #include <linux/init.h>
> @@ -76,3 +78,4 @@ struct twl4030_power_data generic3430_t2  };
>  
>  
> +#endif /* CONFIG_TWL4030_POWER */
> --- a/arch/arm/mach-omap2/twl4030-generic-scripts.h
> +++ b/arch/arm/mach-omap2/twl4030-generic-scripts.h
> @@ -3,6 +3,11 @@
>  
>  #include <linux/i2c/twl4030.h>
>  
> +#ifdef CONFIG_TWL4030_POWER
>  extern struct twl4030_power_data generic3430_t2scripts_data;
> +#define GENERIC3430_T2SCRIPTS_DATA &generic3430_t2scripts_data #else 
> +#define GENERIC3430_T2SCRIPTS_DATA NULL #endif /* 
> CONFIG_TWL4030_POWER 
> +*/
>  
>  #endif
> 
> 
> --
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix section mismatch warning.
  2008-11-20 12:44   ` Premi, Sanjeev
@ 2008-11-20 12:55     ` Felipe Balbi
  2008-11-21  0:14       ` David Brownell
  2008-11-20 13:41     ` David Brownell
  1 sibling, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2008-11-20 12:55 UTC (permalink / raw)
  To: ext Premi, Sanjeev; +Cc: David Brownell, linux-omap@vger.kernel.org

On Thu, Nov 20, 2008 at 06:14:55PM +0530, ext Premi, Sanjeev wrote:
> 
> > -----Original Message-----
> > From: David Brownell [mailto:david-b@pacbell.net] 
> > Sent: Thursday, November 20, 2008 5:56 AM
> > To: Premi, Sanjeev
> > Cc: linux-omap@vger.kernel.org
> > Subject: Re: [PATCH] Fix section mismatch warning.
> > 
> > I know that Beagle and Overo get the same warnings, so this 
> > isn't really a sufficient fix...
> 
> Was trying to fix for EVM. Can extend to these boards once we have a fix.
> 
> > 
> > On Wednesday 19 November 2008, Sanjeev Premi wrote:
> > > --- a/arch/arm/mach-omap2/board-omap3evm.c
> > > +++ b/arch/arm/mach-omap2/board-omap3evm.c
> > > @@ -130,7 +130,7 @@ static struct twl4030_madc_platform_data 
> > > omap3evm_madc_data = {
> > >         .irq_line       = 1,
> > >  };
> > >  
> > > -static struct twl4030_platform_data omap3evm_twldata = {
> > > +static struct twl4030_platform_data __initdata omap3evm_twldata = {
> > 
> > ... and that's incorrect in any case, since that data is used 
> > by probe() code that's doesn't sit in an init section.

__initdata_or_module would do the trick for static and dynamically
linked modules. When building it statically, we'd get a bit of
shrinkage, right ?

> Function probe() would be in __devinit. Changing __initdata to __devinit
> would be fine for compilation. Do you see any issues with it?

doesn't make sense.

> BTW, I could not locate the definition of platform_driver for twl4030
> to verify if probe() is indeed in __devinit.

It's in drivers/base/platform.c

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix section mismatch warning.
  2008-11-20 12:44   ` Premi, Sanjeev
  2008-11-20 12:55     ` Felipe Balbi
@ 2008-11-20 13:41     ` David Brownell
  1 sibling, 0 replies; 6+ messages in thread
From: David Brownell @ 2008-11-20 13:41 UTC (permalink / raw)
  To: Premi, Sanjeev; +Cc: linux-omap@vger.kernel.org

On Thursday 20 November 2008, Premi, Sanjeev wrote:
> BTW, I could not locate the definition of platform_driver for twl4030
> to verify if probe() is indeed in __devinit.

In this case, drivers/mfd/twl4030-power.c is what will use that
data, and it's called from drivers/mfd/twl4030-core.c ... which
is an I2C client.

I don't know of any cases when it's safe to have I2C drivers
have their probe() use an __init or __devinit annotation.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix section mismatch warning.
  2008-11-20 12:55     ` Felipe Balbi
@ 2008-11-21  0:14       ` David Brownell
  0 siblings, 0 replies; 6+ messages in thread
From: David Brownell @ 2008-11-21  0:14 UTC (permalink / raw)
  To: felipe.balbi; +Cc: ext Premi, Sanjeev, linux-omap@vger.kernel.org

On Thursday 20 November 2008, Felipe Balbi wrote:
> > > > -static struct twl4030_platform_data omap3evm_twldata = {
> > > > +static struct twl4030_platform_data __initdata omap3evm_twldata = {
> > > 
> > > ... and that's incorrect in any case, since that data is used 
> > > by probe() code that's doesn't sit in an init section.
> 
> __initdata_or_module would do the trick for static and dynamically
> linked modules.

Not in this case.  Recall there are several drivers who
would all need to be using non-hotpluggable structures ...
but since the root of their tree must be hotpluggable,
they can't work that way.


> When building it statically, we'd get a bit of 
> shrinkage, right ?

Can't work that way.
 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-21  0:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-19 13:52 [PATCH] Fix section mismatch warning Sanjeev Premi
2008-11-20  0:26 ` David Brownell
2008-11-20 12:44   ` Premi, Sanjeev
2008-11-20 12:55     ` Felipe Balbi
2008-11-21  0:14       ` David Brownell
2008-11-20 13:41     ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox