Skip to contentSkip to conversation

drivers: bus: omap_interconnect: Fix rand-config build warning

PATCH New Lokesh Vutla 3 participants 10 messages Oct 17, 2012 – Nov 28, 2012 OMAP2+ support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

---
 drivers/bus/omap_l3_noc.c |    9 +++++++++
 drivers/bus/omap_l3_smx.c |   10 ++++++++++
 2 files changed, 19 insertions(+)
drivers/bus/omap_l3_noc.c +9 -0
index d15225f..8222a33 100644
@@ -257,10 +257,19 @@ static int __init omap4_l3_init(void)
 {
 	return platform_driver_register(&omap4_l3_driver);
 }
+#ifndef CONFIG_OMAP_INTERCONNECT_MODULE
 postcore_initcall_sync(omap4_l3_init);
+#else
+module_init(omap4_l3_init);
+#endif
 
 static void __exit omap4_l3_exit(void)
 {
 	platform_driver_unregister(&omap4_l3_driver);
 }
 module_exit(omap4_l3_exit);
+
+MODULE_ALIAS("platform: omap_l3_noc");
+MODULE_AUTHOR("Texas Instruments Inc.");
+MODULE_DESCRIPTION("OMAP4XXX L3 Interconnect Driver");
+MODULE_LICENSE("GPL v2");
drivers/bus/omap_l3_smx.c +10 -0
index acc2164..00f712d 100644
@@ -22,6 +22,7 @@
  * USA
  */
 
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/platform_device.h>
@@ -288,10 +289,19 @@ static int __init omap3_l3_init(void)
 {
 	return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe);
 }
+#ifndef CONFIG_OMAP_INTERCONNECT_MODULE
 postcore_initcall_sync(omap3_l3_init);
+#else
+module_init(omap3_l3_init);
+#endif
 
 static void __exit omap3_l3_exit(void)
 {
 	platform_driver_unregister(&omap3_l3_driver);
 }
 module_exit(omap3_l3_exit);
+
+MODULE_ALIAS("platform: omap_l3_smx");
+MODULE_AUTHOR("Texas Instruments Inc.");
+MODULE_DESCRIPTION("OMAP3XXX L3 Interconnect Driver");
+MODULE_LICENSE("GPL v2");
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

(Looping Arnd and Olof)

Quoted 14 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Quoted 6 lines

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

---

Thanks for the fix Lokesh. Looks fine to me.

maintainer
#2 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Quoted 20 lines · Santosh Shilimkar

(Looping Arnd and Olof)

Quoted 17 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

Quoted 6 lines
Quoted 3 lines

---

Thanks for the fix Lokesh. Looks fine to me.

Looks like nobody else has picked this up so I'll queue this along with few other omap warnings and regressions.

Regards,

Tony

maintainer
#3 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Santosh Shilimkar

(Looping Arnd and Olof)

Quoted 20 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

---

Quoted 6 lines
Quoted 3 lines

Thanks for the fix Lokesh. Looks fine to me.

Looks like nobody else has picked this up so I'll queue this along with few other omap warnings and regressions.

Hmm actually this might require some more discussion. If we make it use regular initcalls, then the ugly ifdefs can be left out. Is there a reason to init this early, can't we just use regular initcalls?

Dropping the patch for now anyways.

Regards,

Tony

#4 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Quoted 29 lines · Tony Lindgren
Quoted 28 lines · Tony Lindgren
Quoted 26 lines · Santosh Shilimkar

(Looping Arnd and Olof)

Quoted 14 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Quoted 6 lines

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

---

Thanks for the fix Lokesh. Looks fine to me.

Quoted 8 lines
Quoted 2 lines

Looks like nobody else has picked this up so I'll queue this along with few other omap warnings and regressions.

Hmm actually this might require some more discussion. If we make it use regular initcalls, then the ugly ifdefs can be left out. Is there a reason to init this early, can't we just use regular initcalls?

I thought about it. The whole reason we want interconnect errors enabled early in the boot to avoid bad accesses issued on interconnect in early boot by various init codes. We managed to discovered many init sequence issues where the a driver is trying to access registers when clocks are not active, or drivers are using bad mapping. At times these errors gets un-noticed because of the behavior of interconnect and later causes serious issues. Leaving the driver init late in the boot means we can't catch any of the issues happen till the L3 driver init happens.

Regards
Santosh

maintainer
#5 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Quoted 38 lines · Santosh Shilimkar
Quoted 29 lines · Tony Lindgren
Quoted 28 lines · Tony Lindgren
Quoted 26 lines · Santosh Shilimkar

(Looping Arnd and Olof)

Quoted 14 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Quoted 6 lines

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

---

Thanks for the fix Lokesh. Looks fine to me.

Quoted 8 lines
Quoted 2 lines

Looks like nobody else has picked this up so I'll queue this along with few other omap warnings and regressions.

Hmm actually this might require some more discussion. If we make it use regular initcalls, then the ugly ifdefs can be left out. Is there a reason to init this early, can't we just use regular initcalls?

Quoted 10 lines

I thought about it. The whole reason we want interconnect errors enabled early in the boot to avoid bad accesses issued on interconnect
in early boot by various init codes. We managed to discovered many init sequence issues where the a driver is trying to access registers when clocks are not active, or drivers are using bad mapping. At times these errors gets un-noticed because of the behavior of interconnect and later causes serious issues. Leaving the driver init late in the boot means we can't catch any of the issues happen till the L3 driver init happens.

OK yeah that makes sense. How about let's just make it just postcore_initcall instead of postcore_initcall_sync?

In include/linux/module.h we have:

...
#else /* MODULE */

/* Don't use these in loadable modules, but some people do... */

#define early_initcall(fn)              module_init(fn)
#define core_initcall(fn)               module_init(fn)
#define postcore_initcall(fn)           module_init(fn)

...

While the postcore_initcall_sync does not have those.

No idea what the current plan is, but I sort of remember reading that the _sync versions are going away at some point anyways?

Regards,

Tony

#6 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Quoted 50 lines · Tony Lindgren
Quoted 38 lines · Santosh Shilimkar
Quoted 29 lines · Tony Lindgren
Quoted 28 lines · Tony Lindgren
Quoted 26 lines · Santosh Shilimkar

(Looping Arnd and Olof)

Quoted 14 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o
drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o
drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Quoted 6 lines

Adding module_init() and macros in omap_l3_noc/smx drivers when building as modules to remove the above warning.

---

Thanks for the fix Lokesh. Looks fine to me.

Quoted 8 lines
Quoted 2 lines

Looks like nobody else has picked this up so I'll queue this along with few other omap warnings and regressions.

Hmm actually this might require some more discussion. If we make it use regular initcalls, then the ugly ifdefs can be left out. Is there a reason to init this early, can't we just use regular initcalls?

Quoted 10 lines

I thought about it. The whole reason we want interconnect errors enabled early in the boot to avoid bad accesses issued on interconnect
in early boot by various init codes. We managed to discovered many init sequence issues where the a driver is trying to access registers when clocks are not active, or drivers are using bad mapping. At times these errors gets un-noticed because of the behavior of interconnect and later causes serious issues. Leaving the driver init late in the boot means we can't catch any of the issues happen till the L3 driver init happens.

Quoted 3 lines

OK yeah that makes sense. How about let's just make it just postcore_initcall instead of postcore_initcall_sync?

_sync was added by purpose since the driver has depedency on the hwmod initialisation which is postcore_initcall. Without the sync, we open the race condition and the l3 driver registration will fail.

Quoted 9 lines

In include/linux/module.h we have:

...
#else /* MODULE */

/* Don't use these in loadable modules, but some people do... */

#define early_initcall(fn)              module_init(fn)
#define core_initcall(fn)               module_init(fn)
#define postcore_initcall(fn)           module_init(fn)
Quoted 7 lines

...

While the postcore_initcall_sync does not have those.

No idea what the current plan is, but I sort of remember reading that the _sync versions are going away at some point anyways?

I have no idea either. As mentioned sync was added to avoid the race. If and when _sync is removed, something should come as an alternative to avoid initcall completion dependencies for the one which falls in same group.

Regards,
Santosh

#7 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Hi Tony,

Quoted 81 lines · Santosh Shilimkar
Quoted 59 lines · Tony Lindgren
Quoted 47 lines · Santosh Shilimkar
Quoted 38 lines · Tony Lindgren
Quoted 37 lines · Tony Lindgren
Quoted 35 lines · Santosh Shilimkar

(Looping Arnd and Olof)

Quoted 22 lines · Lokesh Vutla

When building omap_l3_noc/smx drivers as modules, the following warning appears:

CC [M] drivers/bus/omap_l3_smx.o drivers/bus/omap_l3_smx.c:291: warning: data definition has no type or storage class
drivers/bus/omap_l3_smx.c:291: warning: type defaults to 'int' in declaration of 'postcore_initcall_sync' drivers/bus/omap_l3_smx.c:291: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_smx.c:287: warning: 'omap3_l3_init' defined but not used
CC [M] drivers/bus/omap_l3_noc.o drivers/bus/omap_l3_noc.c:260: warning: data definition has no type or storage class
drivers/bus/omap_l3_noc.c:260: warning: type defaults to 'int' in declaration of 'arch_initcall_sync' drivers/bus/omap_l3_noc.c:260: warning: parameter names (without types) in function declaration drivers/bus/omap_l3_noc.c:256: warning: 'omap4_l3_init' defined but not used

Quoted 7 lines

Adding module_init() and macros in omap_l3_noc/smx drivers when building
as modules to remove the above warning.

---

Thanks for the fix Lokesh. Looks fine to me.

Quoted 8 lines
Quoted 2 lines

Looks like nobody else has picked this up so I'll queue this along with few other omap warnings and regressions.

Hmm actually this might require some more discussion. If we make it use regular initcalls, then the ugly ifdefs can be left out. Is there a reason to init this early, can't we just use regular initcalls?

Quoted 10 lines

I thought about it. The whole reason we want interconnect errors enabled early in the boot to avoid bad accesses issued on interconnect
in early boot by various init codes. We managed to discovered many init sequence issues where the a driver is trying to access registers when clocks are not active, or drivers are using bad mapping. At times these errors gets un-noticed because of the behavior of interconnect and later causes serious issues. Leaving the driver init late in the boot means we can't catch any of the issues happen till the L3 driver init happens.

Quoted 3 lines

OK yeah that makes sense. How about let's just make it just postcore_initcall instead of postcore_initcall_sync?

_sync was added by purpose since the driver has depedency on the hwmod initialisation which is postcore_initcall. Without the sync, we open the race condition and the l3 driver registration will fail.

Quoted 13 lines

In include/linux/module.h we have:

...
#else /* MODULE */

/* Don't use these in loadable modules, but some people do... */

#define early_initcall(fn)              module_init(fn)
#define core_initcall(fn)               module_init(fn)
#define postcore_initcall(fn)           module_init(fn)

...

While the postcore_initcall_sync does not have those.

Quoted 7 lines
Quoted 3 lines

No idea what the current plan is, but I sort of remember reading that the _sync versions are going away at some point anyways?

I have no idea either. As mentioned sync was added to avoid the race. If and when _sync is removed, something should come as an alternative to avoid initcall completion dependencies for the one which falls in same group.

Is the above discussion fine for you ?
Will you pick this patch or
you want any more modifications ?

Thanks
Lokesh

Quoted 5 lines

Regards,
Santosh

maintainer
#8 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Quoted 3 lines · Lokesh Vutla

Is the above discussion fine for you ?
Will you pick this patch or
you want any more modifications ?

Let's see what Arnd says.

Regards,

Tony

#9 lore raw

PATCH 1/1 drivers: bus: omap_interconnect: Fix rand-config build warning

Hi,

Quoted 6 lines · Tony Lindgren
Quoted 3 lines · Lokesh Vutla

Is the above discussion fine for you ?
Will you pick this patch or
you want any more modifications ?

Let's see what Arnd says.

Gentle ping on this...

Thanks
Lokesh

Quoted 5 lines

Regards,

Tony