* [PATCH 1/2] soc: fsl: make it explicitly non-modular
@ 2016-11-16 16:39 Sudeep Holla
2016-11-16 16:39 ` [PATCH 2/2] soc: fsl: fix section mismatch build warnings Sudeep Holla
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Sudeep Holla @ 2016-11-16 16:39 UTC (permalink / raw)
To: linuxppc-dev
Cc: Sudeep Holla, linux-kernel, Scott Wood, Yangbo Lu, Arnd Bergmann
The Kconfig currently controlling compilation of this code is:
drivers/soc/fsl/Kconfig:config FSL_GUTS
drivers/soc/fsl/Kconfig: bool
...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.
Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.
Cc: Scott Wood <oss@buserror.net>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/soc/fsl/guts.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index 0ac88263c2d7..885409d84eb2 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -11,7 +11,6 @@
#include <linux/io.h>
#include <linux/slab.h>
-#include <linux/module.h>
#include <linux/of_fdt.h>
#include <linux/sys_soc.h>
#include <linux/of_address.h>
@@ -212,7 +211,6 @@ static const struct of_device_id fsl_guts_of_match[] = {
{ .compatible = "fsl,ls2080a-dcfg", },
{}
};
-MODULE_DEVICE_TABLE(of, fsl_guts_of_match);
static struct platform_driver fsl_guts_driver = {
.driver = {
@@ -228,9 +226,3 @@ static int __init fsl_guts_init(void)
return platform_driver_register(&fsl_guts_driver);
}
core_initcall(fsl_guts_init);
-
-static void __exit fsl_guts_exit(void)
-{
- platform_driver_unregister(&fsl_guts_driver);
-}
-module_exit(fsl_guts_exit);
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] soc: fsl: fix section mismatch build warnings
2016-11-16 16:39 [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
@ 2016-11-16 16:39 ` Sudeep Holla
2016-11-16 17:07 ` Arnd Bergmann
2016-11-17 15:11 ` [PATCH v2 -next] " Sudeep Holla
2016-11-16 16:41 ` [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
2016-11-17 11:48 ` Sudeep Holla
2 siblings, 2 replies; 9+ messages in thread
From: Sudeep Holla @ 2016-11-16 16:39 UTC (permalink / raw)
To: linuxppc-dev
Cc: Sudeep Holla, linux-kernel, Scott Wood, Yangbo Lu, Arnd Bergmann
We get the following warning with the driver is compiled in:
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
With CONFIG_DEBUG_SECTION_MISMATCH enabled, the details are reported:
WARNING: vmlinux.o(.text+0x55d014): Section mismatch in reference from the
function fsl_guts_probe() to the function
.init.text:of_flat_dt_get_machine_name()
The function fsl_guts_probe() references
the function __init of_flat_dt_get_machine_name().
This is often because fsl_guts_probe lacks a __init
annotation or the annotation of of_flat_dt_get_machine_name is wrong.
This patch stashes the machine name during fsl_guts_init initcall to
fix the above warnings.
Cc: Scott Wood <oss@buserror.net>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/soc/fsl/guts.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index 885409d84eb2..5513a2b3448f 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -31,6 +31,7 @@ struct fsl_soc_die_attr {
static struct guts *guts;
static struct soc_device_attribute soc_dev_attr;
static struct soc_device *soc_dev;
+static const char *machine;
/* SoC die attribute definition for QorIQ platform */
@@ -135,7 +136,6 @@ static int fsl_guts_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct resource *res;
const struct fsl_soc_die_attr *soc_die;
- const char *machine;
u32 svr;
/* Initialize guts */
@@ -151,7 +151,6 @@ static int fsl_guts_probe(struct platform_device *pdev)
return PTR_ERR(guts->regs);
/* Register soc device */
- machine = of_flat_dt_get_machine_name();
if (machine)
soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL);
@@ -223,6 +222,7 @@ static struct platform_driver fsl_guts_driver = {
static int __init fsl_guts_init(void)
{
+ machine = of_flat_dt_get_machine_name();
return platform_driver_register(&fsl_guts_driver);
}
core_initcall(fsl_guts_init);
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] soc: fsl: make it explicitly non-modular
2016-11-16 16:39 [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
2016-11-16 16:39 ` [PATCH 2/2] soc: fsl: fix section mismatch build warnings Sudeep Holla
@ 2016-11-16 16:41 ` Sudeep Holla
2016-11-17 11:48 ` Sudeep Holla
2 siblings, 0 replies; 9+ messages in thread
From: Sudeep Holla @ 2016-11-16 16:41 UTC (permalink / raw)
To: linuxppc-dev
Cc: Sudeep Holla, linux-kernel, Scott Wood, Yangbo Lu, Arnd Bergmann
On 16/11/16 16:39, Sudeep Holla wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/soc/fsl/Kconfig:config FSL_GUTS
> drivers/soc/fsl/Kconfig: bool
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
>
Sorry I forgot to append -next as these are applicable only to linux-next
> Cc: Scott Wood <oss@buserror.net>
> Cc: Yangbo Lu <yangbo.lu@nxp.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> drivers/soc/fsl/guts.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
> index 0ac88263c2d7..885409d84eb2 100644
> --- a/drivers/soc/fsl/guts.c
> +++ b/drivers/soc/fsl/guts.c
> @@ -11,7 +11,6 @@
>
> #include <linux/io.h>
> #include <linux/slab.h>
> -#include <linux/module.h>
> #include <linux/of_fdt.h>
> #include <linux/sys_soc.h>
> #include <linux/of_address.h>
> @@ -212,7 +211,6 @@ static const struct of_device_id fsl_guts_of_match[] = {
> { .compatible = "fsl,ls2080a-dcfg", },
> {}
> };
> -MODULE_DEVICE_TABLE(of, fsl_guts_of_match);
>
> static struct platform_driver fsl_guts_driver = {
> .driver = {
> @@ -228,9 +226,3 @@ static int __init fsl_guts_init(void)
> return platform_driver_register(&fsl_guts_driver);
> }
> core_initcall(fsl_guts_init);
> -
> -static void __exit fsl_guts_exit(void)
> -{
> - platform_driver_unregister(&fsl_guts_driver);
> -}
> -module_exit(fsl_guts_exit);
>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] soc: fsl: fix section mismatch build warnings
2016-11-16 16:39 ` [PATCH 2/2] soc: fsl: fix section mismatch build warnings Sudeep Holla
@ 2016-11-16 17:07 ` Arnd Bergmann
2016-11-16 17:10 ` Sudeep Holla
2016-11-17 15:11 ` [PATCH v2 -next] " Sudeep Holla
1 sibling, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2016-11-16 17:07 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Sudeep Holla, Scott Wood, Yangbo Lu, linux-kernel
On Wednesday, November 16, 2016 4:39:27 PM CET Sudeep Holla wrote:
> @@ -223,6 +222,7 @@ static struct platform_driver fsl_guts_driver = {
>
> static int __init fsl_guts_init(void)
> {
> + machine = of_flat_dt_get_machine_name();
> return platform_driver_register(&fsl_guts_driver);
> }
> core_initcall(fsl_guts_init);
I think we simply need to use the normal DT API rather than the of_flat_* one.
Arnd
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] soc: fsl: fix section mismatch build warnings
2016-11-16 17:07 ` Arnd Bergmann
@ 2016-11-16 17:10 ` Sudeep Holla
0 siblings, 0 replies; 9+ messages in thread
From: Sudeep Holla @ 2016-11-16 17:10 UTC (permalink / raw)
To: Arnd Bergmann, linuxppc-dev
Cc: Sudeep Holla, Scott Wood, Yangbo Lu, linux-kernel
On 16/11/16 17:07, Arnd Bergmann wrote:
> On Wednesday, November 16, 2016 4:39:27 PM CET Sudeep Holla wrote:
>> @@ -223,6 +222,7 @@ static struct platform_driver fsl_guts_driver = {
>>
>> static int __init fsl_guts_init(void)
>> {
>> + machine = of_flat_dt_get_machine_name();
>> return platform_driver_register(&fsl_guts_driver);
>> }
>> core_initcall(fsl_guts_init);
>
> I think we simply need to use the normal DT API rather than the of_flat_* one.
>
I thought so, yes that will be better. I will respin accordingly.
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] soc: fsl: make it explicitly non-modular
2016-11-16 16:39 [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
2016-11-16 16:39 ` [PATCH 2/2] soc: fsl: fix section mismatch build warnings Sudeep Holla
2016-11-16 16:41 ` [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
@ 2016-11-17 11:48 ` Sudeep Holla
2 siblings, 0 replies; 9+ messages in thread
From: Sudeep Holla @ 2016-11-17 11:48 UTC (permalink / raw)
To: linuxppc-dev
Cc: Sudeep Holla, linux-kernel, Scott Wood, Yangbo Lu, Arnd Bergmann
On 16/11/16 16:39, Sudeep Holla wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/soc/fsl/Kconfig:config FSL_GUTS
> drivers/soc/fsl/Kconfig: bool
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
>
> Cc: Scott Wood <oss@buserror.net>
> Cc: Yangbo Lu <yangbo.lu@nxp.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
I saw Paul Gortmaker had sent similar patch on Nov 15, so drop/ignore this.
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 -next] soc: fsl: fix section mismatch build warnings
2016-11-16 16:39 ` [PATCH 2/2] soc: fsl: fix section mismatch build warnings Sudeep Holla
2016-11-16 17:07 ` Arnd Bergmann
@ 2016-11-17 15:11 ` Sudeep Holla
2016-11-17 15:25 ` Arnd Bergmann
1 sibling, 1 reply; 9+ messages in thread
From: Sudeep Holla @ 2016-11-17 15:11 UTC (permalink / raw)
To: linux-kernel
Cc: Sudeep Holla, linux-mmc, Scott Wood, Yangbo Lu, Arnd Bergmann,
Ulf Hansson
We get the following warning with the driver is compiled in:
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
With CONFIG_DEBUG_SECTION_MISMATCH enabled, the details are reported:
WARNING: vmlinux.o(.text+0x55d014): Section mismatch in reference from the
function fsl_guts_probe() to the function
.init.text:of_flat_dt_get_machine_name()
The function fsl_guts_probe() references
the function __init of_flat_dt_get_machine_name().
This is often because fsl_guts_probe lacks a __init
annotation or the annotation of of_flat_dt_get_machine_name is wrong.
This patch fixes the issue by using the normal DT/OF API rather than
the of_flat_* one.
Cc: Scott Wood <oss@buserror.net>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/soc/fsl/guts.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
v1->v2:
- As suggested by Arnd, used standard DT APIs over of_flat_* API
diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index 0ac88263c2d7..6af7a11f09a5 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -132,7 +132,7 @@ EXPORT_SYMBOL(fsl_guts_get_svr);
static int fsl_guts_probe(struct platform_device *pdev)
{
- struct device_node *np = pdev->dev.of_node;
+ struct device_node *root, *np = pdev->dev.of_node;
struct device *dev = &pdev->dev;
struct resource *res;
const struct fsl_soc_die_attr *soc_die;
@@ -152,7 +152,10 @@ static int fsl_guts_probe(struct platform_device *pdev)
return PTR_ERR(guts->regs);
/* Register soc device */
- machine = of_flat_dt_get_machine_name();
+ root = of_find_node_by_path("/");
+ if (of_property_read_string(root, "model", &machine))
+ of_property_read_string_index(root, "compatible", 0, &machine);
+ of_node_put(root);
if (machine)
soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL);
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 -next] soc: fsl: fix section mismatch build warnings
2016-11-17 15:11 ` [PATCH v2 -next] " Sudeep Holla
@ 2016-11-17 15:25 ` Arnd Bergmann
2016-11-18 14:30 ` Ulf Hansson
0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2016-11-17 15:25 UTC (permalink / raw)
To: Ulf Hansson; +Cc: Sudeep Holla, linux-kernel, linux-mmc, Scott Wood, Yangbo Lu
On Thursday, November 17, 2016 3:11:59 PM CET Sudeep Holla wrote:
>
> Cc: Scott Wood <oss@buserror.net>
> Cc: Yangbo Lu <yangbo.lu@nxp.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Ulf, can you pick this up into the mmc tree?
Arnd
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 -next] soc: fsl: fix section mismatch build warnings
2016-11-17 15:25 ` Arnd Bergmann
@ 2016-11-18 14:30 ` Ulf Hansson
0 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2016-11-18 14:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sudeep Holla, linux-kernel, linux-mmc, Scott Wood, Yangbo Lu
On 17 November 2016 at 16:25, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday, November 17, 2016 3:11:59 PM CET Sudeep Holla wrote:
>>
>> Cc: Scott Wood <oss@buserror.net>
>> Cc: Yangbo Lu <yangbo.lu@nxp.com>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Ulf Hansson <ulf.hansson@linaro.org>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> Ulf, can you pick this up into the mmc tree?
Yes, I have applied it for my next branch, thanks!
Kind regards
Uffe
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-11-18 14:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 16:39 [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
2016-11-16 16:39 ` [PATCH 2/2] soc: fsl: fix section mismatch build warnings Sudeep Holla
2016-11-16 17:07 ` Arnd Bergmann
2016-11-16 17:10 ` Sudeep Holla
2016-11-17 15:11 ` [PATCH v2 -next] " Sudeep Holla
2016-11-17 15:25 ` Arnd Bergmann
2016-11-18 14:30 ` Ulf Hansson
2016-11-16 16:41 ` [PATCH 1/2] soc: fsl: make it explicitly non-modular Sudeep Holla
2016-11-17 11:48 ` Sudeep Holla
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.