diff mbox series

[2/2] ARM: imx: mach-imx7ulp: warn when imx_soc_device_init fail

Message ID 20190313091757.16410-2-peng.fan@nxp.com (mailing list archive)
State New, archived
Headers show
Series [1/2] ARM: imx: drop uneccessary of_platform_default_populate | expand

Commit Message

Peng Fan March 13, 2019, 9:05 a.m. UTC
Follow other i.MX6/7 machince code to check return value
of imx_soc_device_init and warn when fail.

Also drop of_platform_default_populate, because
"arch_initcall_sync(of_platform_default_populate_init);" could be
used to populate the device tree.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/mach-imx7ulp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Dong Aisheng March 15, 2019, 10:22 a.m. UTC | #1
> From: Peng Fan
>
> [PATCH 2/2] ARM: imx: mach-imx7ulp: warn when imx_soc_device_init fail

ARM: imx: imx7ulp: ...

> Follow other i.MX6/7 machince code to check return value of
> imx_soc_device_init and warn when fail.
> 
> Also drop of_platform_default_populate, because
> "arch_initcall_sync(of_platform_default_populate_init);" could be used to
> populate the device tree.
> 

This could be in separate patch.

> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  arch/arm/mach-imx/mach-imx7ulp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/mach-imx7ulp.c
> b/arch/arm/mach-imx/mach-imx7ulp.c
> index 11ac71aaf965..6d823f05d9aa 100644
> --- a/arch/arm/mach-imx/mach-imx7ulp.c
> +++ b/arch/arm/mach-imx/mach-imx7ulp.c
> @@ -53,11 +53,16 @@ static void __init imx7ulp_set_revision(void)
> 
>  static void __init imx7ulp_init_machine(void)  {
> +	struct device *soc_dev;
> +
> +	soc_dev = imx_soc_device_init();
> +	if (soc_dev == NULL)
> +		pr_warn("failed to initialize soc device\n");
> +

Should this be under set revision?

Regards
Dong Aisheng

>  	imx7ulp_pm_init();
> 
>  	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
>  	imx7ulp_set_revision();
> -	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
>  }
> 
>  static const char *const imx7ulp_dt_compat[] __initconst = {
> --
> 2.16.4
Peng Fan March 15, 2019, 12:58 p.m. UTC | #2
> -----Original Message-----
> From: Aisheng Dong
> Sent: 2019年3月15日 18:22
> To: Peng Fan <peng.fan@nxp.com>; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; Anson Huang <anson.huang@nxp.com>;
> arnd@arndb.de; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org
> Cc: van.freenix@gmail.com
> Subject: RE: [PATCH 2/2] ARM: imx: mach-imx7ulp: warn when
> imx_soc_device_init fail
> 
> > From: Peng Fan
> >
> > [PATCH 2/2] ARM: imx: mach-imx7ulp: warn when imx_soc_device_init fail
> 
> ARM: imx: imx7ulp: ...

Ok.
> 
> > Follow other i.MX6/7 machince code to check return value of
> > imx_soc_device_init and warn when fail.
> >
> > Also drop of_platform_default_populate, because
> > "arch_initcall_sync(of_platform_default_populate_init);" could be used
> > to populate the device tree.
> >
> 
> This could be in separate patch.

I'll do it in v2 after we agree the change in the first patch.

> 
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  arch/arm/mach-imx/mach-imx7ulp.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-imx/mach-imx7ulp.c
> > b/arch/arm/mach-imx/mach-imx7ulp.c
> > index 11ac71aaf965..6d823f05d9aa 100644
> > --- a/arch/arm/mach-imx/mach-imx7ulp.c
> > +++ b/arch/arm/mach-imx/mach-imx7ulp.c
> > @@ -53,11 +53,16 @@ static void __init imx7ulp_set_revision(void)
> >
> >  static void __init imx7ulp_init_machine(void)  {
> > +	struct device *soc_dev;
> > +
> > +	soc_dev = imx_soc_device_init();
> > +	if (soc_dev == NULL)
> > +		pr_warn("failed to initialize soc device\n");
> > +
> 
> Should this be under set revision?

Just follow other i.MX6/7 platforms practice, I could move
this under set revision in v2 if you prefer.

Thanks,
Peng.

> 
> Regards
> Dong Aisheng
> 
> >  	imx7ulp_pm_init();
> >
> >  	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
> >  	imx7ulp_set_revision();
> > -	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
> >  }
> >
> >  static const char *const imx7ulp_dt_compat[] __initconst = {
> > --
> > 2.16.4
Dong Aisheng March 15, 2019, 1:40 p.m. UTC | #3
[...]

> > > Follow other i.MX6/7 machince code to check return value of
> > > imx_soc_device_init and warn when fail.
> > >
> > > Also drop of_platform_default_populate, because
> > > "arch_initcall_sync(of_platform_default_populate_init);" could be
> > > used to populate the device tree.
> > >
> >
> > This could be in separate patch.
> 
> I'll do it in v2 after we agree the change in the first patch.
> 

I think imx7ulp does not have the issue in patch 1.

Regards
Dong Aisheng

> >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  arch/arm/mach-imx/mach-imx7ulp.c | 7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/mach-imx/mach-imx7ulp.c
> > > b/arch/arm/mach-imx/mach-imx7ulp.c
> > > index 11ac71aaf965..6d823f05d9aa 100644
> > > --- a/arch/arm/mach-imx/mach-imx7ulp.c
> > > +++ b/arch/arm/mach-imx/mach-imx7ulp.c
> > > @@ -53,11 +53,16 @@ static void __init imx7ulp_set_revision(void)
> > >
> > >  static void __init imx7ulp_init_machine(void)  {
> > > +	struct device *soc_dev;
> > > +
> > > +	soc_dev = imx_soc_device_init();
> > > +	if (soc_dev == NULL)
> > > +		pr_warn("failed to initialize soc device\n");
> > > +
> >
> > Should this be under set revision?
> 
> Just follow other i.MX6/7 platforms practice, I could move this under set
> revision in v2 if you prefer.
> 
> Thanks,
> Peng.
> 
> >
> > Regards
> > Dong Aisheng
> >
> > >  	imx7ulp_pm_init();
> > >
> > >  	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
> > >  	imx7ulp_set_revision();
> > > -	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
> > >  }
> > >
> > >  static const char *const imx7ulp_dt_compat[] __initconst = {
> > > --
> > > 2.16.4
Peng Fan March 19, 2019, 12:28 p.m. UTC | #4
> -----Original Message-----
> From: Aisheng Dong
> Sent: 2019年3月15日 21:40
> To: Peng Fan <peng.fan@nxp.com>; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; Anson Huang <anson.huang@nxp.com>;
> arnd@arndb.de; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org
> Cc: van.freenix@gmail.com
> Subject: RE: [PATCH 2/2] ARM: imx: mach-imx7ulp: warn when
> imx_soc_device_init fail
> 
> [...]
> 
> > > > Follow other i.MX6/7 machince code to check return value of
> > > > imx_soc_device_init and warn when fail.
> > > >
> > > > Also drop of_platform_default_populate, because
> > > > "arch_initcall_sync(of_platform_default_populate_init);" could be
> > > > used to populate the device tree.
> > > >
> > >
> > > This could be in separate patch.
> >
> > I'll do it in v2 after we agree the change in the first patch.
> >
> 
> I think imx7ulp does not have the issue in patch 1.

Missed to reply you.
So do you agree to split this patch into two
patches ? or leave the code as it is?

The first is follow other i.mx6/7 to check return value of
imx_soc_device_init. 
The second is drop the call to of_platform_default_populate.

Thanks,
Peng

> 
> Regards
> Dong Aisheng
> 
> > >
> > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > ---
> > > >  arch/arm/mach-imx/mach-imx7ulp.c | 7 ++++++-
> > > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/arm/mach-imx/mach-imx7ulp.c
> > > > b/arch/arm/mach-imx/mach-imx7ulp.c
> > > > index 11ac71aaf965..6d823f05d9aa 100644
> > > > --- a/arch/arm/mach-imx/mach-imx7ulp.c
> > > > +++ b/arch/arm/mach-imx/mach-imx7ulp.c
> > > > @@ -53,11 +53,16 @@ static void __init imx7ulp_set_revision(void)
> > > >
> > > >  static void __init imx7ulp_init_machine(void)  {
> > > > +	struct device *soc_dev;
> > > > +
> > > > +	soc_dev = imx_soc_device_init();
> > > > +	if (soc_dev == NULL)
> > > > +		pr_warn("failed to initialize soc device\n");
> > > > +
> > >
> > > Should this be under set revision?
> >
> > Just follow other i.MX6/7 platforms practice, I could move this under
> > set revision in v2 if you prefer.
> >
> > Thanks,
> > Peng.
> >
> > >
> > > Regards
> > > Dong Aisheng
> > >
> > > >  	imx7ulp_pm_init();
> > > >
> > > >  	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
> > > >  	imx7ulp_set_revision();
> > > > -	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
> > > >  }
> > > >
> > > >  static const char *const imx7ulp_dt_compat[] __initconst = {
> > > > --
> > > > 2.16.4
Dong Aisheng March 20, 2019, 4:57 a.m. UTC | #5
> From: Peng Fan
>
> > > > > Follow other i.MX6/7 machince code to check return value of
> > > > > imx_soc_device_init and warn when fail.
> > > > >
> > > > > Also drop of_platform_default_populate, because
> > > > > "arch_initcall_sync(of_platform_default_populate_init);" could
> > > > > be used to populate the device tree.
> > > > >
> > > >
> > > > This could be in separate patch.
> > >
> > > I'll do it in v2 after we agree the change in the first patch.
> > >
> >
> > I think imx7ulp does not have the issue in patch 1.
> 
> Missed to reply you.
> So do you agree to split this patch into two patches ? or leave the code as it is?
> 

A bit more thinking, i wonder that warning may not be quite necessary
for a new patch. 
So probably leave as it is unless we have more strong reasons.
Sorry about that.

Regards
Dong Aisheng

> The first is follow other i.mx6/7 to check return value of imx_soc_device_init.
> The second is drop the call to of_platform_default_populate.
> 
> Thanks,
> Peng
> 
> >
> > Regards
> > Dong Aisheng
> >
> > > >
> > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > > ---
> > > > >  arch/arm/mach-imx/mach-imx7ulp.c | 7 ++++++-
> > > > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/arch/arm/mach-imx/mach-imx7ulp.c
> > > > > b/arch/arm/mach-imx/mach-imx7ulp.c
> > > > > index 11ac71aaf965..6d823f05d9aa 100644
> > > > > --- a/arch/arm/mach-imx/mach-imx7ulp.c
> > > > > +++ b/arch/arm/mach-imx/mach-imx7ulp.c
> > > > > @@ -53,11 +53,16 @@ static void __init
> > > > > imx7ulp_set_revision(void)
> > > > >
> > > > >  static void __init imx7ulp_init_machine(void)  {
> > > > > +	struct device *soc_dev;
> > > > > +
> > > > > +	soc_dev = imx_soc_device_init();
> > > > > +	if (soc_dev == NULL)
> > > > > +		pr_warn("failed to initialize soc device\n");
> > > > > +
> > > >
> > > > Should this be under set revision?
> > >
> > > Just follow other i.MX6/7 platforms practice, I could move this
> > > under set revision in v2 if you prefer.
> > >
> > > Thanks,
> > > Peng.
> > >
> > > >
> > > > Regards
> > > > Dong Aisheng
> > > >
> > > > >  	imx7ulp_pm_init();
> > > > >
> > > > >  	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
> > > > >  	imx7ulp_set_revision();
> > > > > -	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
> > > > >  }
> > > > >
> > > > >  static const char *const imx7ulp_dt_compat[] __initconst = {
> > > > > --
> > > > > 2.16.4
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/mach-imx7ulp.c b/arch/arm/mach-imx/mach-imx7ulp.c
index 11ac71aaf965..6d823f05d9aa 100644
--- a/arch/arm/mach-imx/mach-imx7ulp.c
+++ b/arch/arm/mach-imx/mach-imx7ulp.c
@@ -53,11 +53,16 @@  static void __init imx7ulp_set_revision(void)
 
 static void __init imx7ulp_init_machine(void)
 {
+	struct device *soc_dev;
+
+	soc_dev = imx_soc_device_init();
+	if (soc_dev == NULL)
+		pr_warn("failed to initialize soc device\n");
+
 	imx7ulp_pm_init();
 
 	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
 	imx7ulp_set_revision();
-	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
 }
 
 static const char *const imx7ulp_dt_compat[] __initconst = {