Patchwork [v3,01/35] ARM: OMAP2+: Register SoC device attributes from machine .init()

login
register
mail settings
Submitter Laurent Pinchart
Date Aug. 4, 2017, 10:43 p.m.
Message ID <20170804224419.30758-2-laurent.pinchart@ideasonboard.com>
Download mbox | patch
Permalink /patch/9882199/
State New
Headers show

Comments

Laurent Pinchart - Aug. 4, 2017, 10:43 p.m.
SoC device attributes are registered with a call to
soc_device_register() from the machine .init_late() operation, which is
called from the late initcall, after all drivers built-in drivers have
been probed. This results in the impossibility for drivers to use SoC
device matching in their probe function.

The omap_soc_device_init() function is safe to call from the machine
.init() operation, as all data it depends on is initialized from the
.init_early() operation. Move SoC device attribute registration to
machine .init() like on all other ARM platforms.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/board-generic.c | 1 +
 arch/arm/mach-omap2/io.c            | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
Tomi Valkeinen - Aug. 9, 2017, 12:56 p.m.
´╗┐This message contains a digitally signed email which can be read by opening the attachment.
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Hi Tony,

On 05/08/17 01:43, Laurent Pinchart wrote:
> SoC device attributes are registered with a call to
> soc_device_register() from the machine .init_late() operation, which is
> called from the late initcall, after all drivers built-in drivers have
> been probed. This results in the impossibility for drivers to use SoC
> device matching in their probe function.
> 
> The omap_soc_device_init() function is safe to call from the machine
> .init() operation, as all data it depends on is initialized from the
> .init_early() operation. Move SoC device attribute registration to
> machine .init() like on all other ARM platforms.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  arch/arm/mach-omap2/board-generic.c | 1 +
>  arch/arm/mach-omap2/io.c            | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
> index dc9e34e670a2..5303402ed5c2 100644
> --- a/arch/arm/mach-omap2/board-generic.c
> +++ b/arch/arm/mach-omap2/board-generic.c
> @@ -33,6 +33,7 @@ static void __init omap_generic_init(void)
>  	pdata_quirks_init(omap_dt_match_table);
>  
>  	omapdss_init_of();
> +	omap_soc_device_init();
>  }
>  
>  #ifdef CONFIG_SOC_OMAP2420
> diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
> index 1d739d1a0a65..952e36b4c4d3 100644
> --- a/arch/arm/mach-omap2/io.c
> +++ b/arch/arm/mach-omap2/io.c
> @@ -428,7 +428,6 @@ static void __init omap_hwmod_init_postsetup(void)
>  static void __init __maybe_unused omap_common_late_init(void)
>  {
>  	omap2_common_pm_late_init();
> -	omap_soc_device_init();
>  }
>  
>  #ifdef CONFIG_SOC_OMAP2420
> 

Tony, how does this look? Can I push it via the drm tree, along with the
series?

 Tomi
Tony Lindgren - Aug. 9, 2017, 9:49 p.m.
* Tomi Valkeinen <tomi.valkeinen@ti.com> [170809 05:57]:
> > diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
> > index dc9e34e670a2..5303402ed5c2 100644
> > --- a/arch/arm/mach-omap2/board-generic.c
> > +++ b/arch/arm/mach-omap2/board-generic.c
> > @@ -33,6 +33,7 @@ static void __init omap_generic_init(void)
> >  	pdata_quirks_init(omap_dt_match_table);
> >  
> >  	omapdss_init_of();
> > +	omap_soc_device_init();
> >  }
> >  
> >  #ifdef CONFIG_SOC_OMAP2420
> > diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
> > index 1d739d1a0a65..952e36b4c4d3 100644
> > --- a/arch/arm/mach-omap2/io.c
> > +++ b/arch/arm/mach-omap2/io.c
> > @@ -428,7 +428,6 @@ static void __init omap_hwmod_init_postsetup(void)
> >  static void __init __maybe_unused omap_common_late_init(void)
> >  {
> >  	omap2_common_pm_late_init();
> > -	omap_soc_device_init();
> >  }
> >  
> >  #ifdef CONFIG_SOC_OMAP2420
> > 
> 
> Tony, how does this look? Can I push it via the drm tree, along with the
> series?

Yes seems safe to me, please feel free to merge it with your
series:

Acked-by: Tony Lindgren <tony@atomide.com>

Patch

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index dc9e34e670a2..5303402ed5c2 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -33,6 +33,7 @@  static void __init omap_generic_init(void)
 	pdata_quirks_init(omap_dt_match_table);
 
 	omapdss_init_of();
+	omap_soc_device_init();
 }
 
 #ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 1d739d1a0a65..952e36b4c4d3 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -428,7 +428,6 @@  static void __init omap_hwmod_init_postsetup(void)
 static void __init __maybe_unused omap_common_late_init(void)
 {
 	omap2_common_pm_late_init();
-	omap_soc_device_init();
 }
 
 #ifdef CONFIG_SOC_OMAP2420