Skip to contentSkip to conversation

OMAP3: hwmod_data: register dss hwmods after dss_core

PATCH Superseded Ilya Yanok 5 participants 7 messages Dec 22, 2011 – Jan 25, 2012

Subsystems (4)
lore
Share & tools
lore

Ilya Yanok

author
#0 lore raw

PATCH 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

dss_core has to be initialized before any other DSS hwmod. Currently this is broken as dss_core is listed in chip/revision specific hwmod lists while other DSS hwmods are listed in common list which is registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list which is registered last to ensure that dss_core is already registered.

CC Tomi Valkeinen <[email protected]>
CC Archit Taneja <[email protected]>
CC Paul Walmsley <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +14 -6
index 5324e8d..85536ff 100644
@@ -3523,12 +3523,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_uart2_hwmod,
 	&omap3xxx_uart3_hwmod,
 
-	/* dss class */
-	&omap3xxx_dss_dispc_hwmod,
-	&omap3xxx_dss_dsi1_hwmod,
-	&omap3xxx_dss_rfbi_hwmod,
-	&omap3xxx_dss_venc_hwmod,
-
 	/* i2c class */
 	&omap3xxx_i2c1_hwmod,
 	&omap3xxx_i2c2_hwmod,
@@ -3635,6 +3629,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = {
 	NULL
 };
 
+static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
+	/* dss class */
+	&omap3xxx_dss_dispc_hwmod,
+	&omap3xxx_dss_dsi1_hwmod,
+	&omap3xxx_dss_rfbi_hwmod,
+	&omap3xxx_dss_venc_hwmod,
+	NULL
+};
+
 int __init omap3xxx_hwmod_init(void)
 {
 	int r;
@@ -3708,6 +3711,11 @@ int __init omap3xxx_hwmod_init(void)
 
 	if (h)
 		r = omap_hwmod_register(h);
+	if (r < 0)
+		return r;
+
+	/* Register common DSS hwmods later than dss_core */
+	r = omap_hwmod_register(omap3xxx_dss_hwmods);
 
 	return r;
 }
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

Hi Ilya,

Thanks for the patch.

Quoted 7 lines · Ilya Yanok

dss_core has to be initialized before any other DSS hwmod. Currently this is broken as dss_core is listed in chip/revision specific hwmod lists while other DSS hwmods are listed in common list which is registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list which is registered last to ensure that dss_core is already registered.

I would suggest to add an in-code comment for this (more descriptive, than the one you did for that patch), and describe the otherwise breakage, so next time it would be a bit harder to break that thing...

Quoted 54 lines
CC Tomi Valkeinen <[email protected]>
CC Archit Taneja <[email protected]>
CC Paul Walmsley <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +14 -6
index 5324e8d..85536ff 100644
@@ -3523,12 +3523,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_uart2_hwmod,
 	&omap3xxx_uart3_hwmod,
 
-	/* dss class */
-	&omap3xxx_dss_dispc_hwmod,
-	&omap3xxx_dss_dsi1_hwmod,
-	&omap3xxx_dss_rfbi_hwmod,
-	&omap3xxx_dss_venc_hwmod,
-
 	/* i2c class */
 	&omap3xxx_i2c1_hwmod,
 	&omap3xxx_i2c2_hwmod,
@@ -3635,6 +3629,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = {
 	NULL
 };
 
+static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
+	/* dss class */
+	&omap3xxx_dss_dispc_hwmod,
+	&omap3xxx_dss_dsi1_hwmod,
+	&omap3xxx_dss_rfbi_hwmod,
+	&omap3xxx_dss_venc_hwmod,
+	NULL
+};
+
 int __init omap3xxx_hwmod_init(void)
 {
 	int r;
@@ -3708,6 +3711,11 @@ int __init omap3xxx_hwmod_init(void)
 
 	if (h)
 		r = omap_hwmod_register(h);
+	if (r < 0)
+		return r;
+
+	/* Register common DSS hwmods later than dss_core */
+	r = omap_hwmod_register(omap3xxx_dss_hwmods);
 
 	return r;
 }
Signature · 2 lines
Regards,
Igor.
author
#2 lore raw

PATCH v2 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

In reply to Ilya Yanok

dss_core has to be initialized before any other DSS hwmod. Currently this is broken as dss_core is listed in chip/revision specific hwmod lists while other DSS hwmods are listed in common list which is registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list which is registered last to ensure that dss_core is already registered.

This solves the problem with BUG() in L3 interrupt handler on boards with DSS enabled in bootloader.

CC Tomi Valkeinen <[email protected]>
CC Archit Taneja <[email protected]>
CC Paul Walmsley <[email protected]>

---

Changes from V1:
- Added extended comment

 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +22 -6
index 5324e8d..f263d3c 100644
@@ -3523,12 +3523,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_uart2_hwmod,
 	&omap3xxx_uart3_hwmod,
 
-	/* dss class */
-	&omap3xxx_dss_dispc_hwmod,
-	&omap3xxx_dss_dsi1_hwmod,
-	&omap3xxx_dss_rfbi_hwmod,
-	&omap3xxx_dss_venc_hwmod,
-
 	/* i2c class */
 	&omap3xxx_i2c1_hwmod,
 	&omap3xxx_i2c2_hwmod,
@@ -3635,6 +3629,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = {
 	NULL
 };
 
+static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
+	/* dss class */
+	&omap3xxx_dss_dispc_hwmod,
+	&omap3xxx_dss_dsi1_hwmod,
+	&omap3xxx_dss_rfbi_hwmod,
+	&omap3xxx_dss_venc_hwmod,
+	NULL
+};
+
 int __init omap3xxx_hwmod_init(void)
 {
 	int r;
@@ -3708,6 +3711,19 @@ int __init omap3xxx_hwmod_init(void)
 
 	if (h)
 		r = omap_hwmod_register(h);
+	if (r < 0)
+		return r;
+
+	/*
+	 * DSS code presumes that dss_core hwmod is handled first,
+	 * _before_ any other DSS related hwmods so register common
+	 * DSS hwmods last to ensure that dss_core is already registered.
+	 * Otherwise some change things may happen, for ex. if dispc
+	 * is handled before dss_core and DSS is enabled in bootloader
+	 * DIPSC will be reset with outputs enabled which sometimes leads
+	 * to unrecoverable L3 error.
+	 */
+	r = omap_hwmod_register(omap3xxx_dss_hwmods);
 
 	return r;
 }
Signature · 1 line
1.7.6.4
#3 lore raw

PATCH v2 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

Hi,

Quoted 63 lines · Ilya Yanok

dss_core has to be initialized before any other DSS hwmod. Currently this is broken as dss_core is listed in chip/revision specific hwmod lists while other DSS hwmods are listed in common list which is registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list which is registered last to ensure that dss_core is already registered.

This solves the problem with BUG() in L3 interrupt handler on boards with DSS enabled in bootloader.

CC Tomi Valkeinen<[email protected]>
CC Archit Taneja<[email protected]>
CC Paul Walmsley<[email protected]>

---

Changes from V1:
- Added extended comment

  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   28 ++++++++++++++++++++++------
  1 files changed, 22 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +12 -6
index 5324e8d..f263d3c 100644
@@ -3523,12 +3523,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
  	&omap3xxx_uart2_hwmod,
  	&omap3xxx_uart3_hwmod,
 
-	/* dss class */
-	&omap3xxx_dss_dispc_hwmod,
-	&omap3xxx_dss_dsi1_hwmod,
-	&omap3xxx_dss_rfbi_hwmod,
-	&omap3xxx_dss_venc_hwmod,
-
  	/* i2c class */
  	&omap3xxx_i2c1_hwmod,
  	&omap3xxx_i2c2_hwmod,
@@ -3635,6 +3629,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = {
  	NULL
  };
 
+static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
+	/* dss class */
+	&omap3xxx_dss_dispc_hwmod,
+	&omap3xxx_dss_dsi1_hwmod,
+	&omap3xxx_dss_rfbi_hwmod,
+	&omap3xxx_dss_venc_hwmod,
+	NULL
+};
+
  int __init omap3xxx_hwmod_init(void)
  {
  	int r;
@@ -3708,6 +3711,19 @@ int __init omap3xxx_hwmod_init(void)
 
  	if (h)
  		r = omap_hwmod_register(h);
+	if (r<  0)
+		return r;
+

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c int __init omap3xxx_hwmod_init(void) · line 3726

Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +10 -0
+	/*
+	 * DSS code presumes that dss_core hwmod is handled first,
+	 * _before_ any other DSS related hwmods so register common
+	 * DSS hwmods last to ensure that dss_core is already registered.
+	 * Otherwise some change things may happen, for ex. if dispc
+	 * is handled before dss_core and DSS is enabled in bootloader
+	 * DIPSC will be reset with outputs enabled which sometimes leads
+	 * to unrecoverable L3 error.
+	 */
+	r = omap_hwmod_register(omap3xxx_dss_hwmods);

This looks fine, but it should be needed for other OMAP2 and OMAP4 also. If you could extend the patch we could test it out for the other OMAPs.

Thanks,
Archit

Quoted 3 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -0
  	return r;
  }
author
#4 lore raw

PATCH v2 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

Hi Archit.

Quoted 2 lines · Archit Taneja

This looks fine, but it should be needed for other OMAP2 and OMAP4 also. If you could extend the patch we could test it out for the other OMAPs.

OMAP2 and OMAP4 don't need this as they have single hwmod list, so correct ordering can be handled just by ordering list items.

Regards, Ilya.

#5 lore raw

PATCH v2 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

In reply to Ilya Yanok

Hi,

Quoted 10 lines · Ilya Yanok

dss_core has to be initialized before any other DSS hwmod. Currently this is broken as dss_core is listed in chip/revision specific hwmod lists while other DSS hwmods are listed in common list which is registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list which is registered last to ensure that dss_core is already registered.

This solves the problem with BUG() in L3 interrupt handler on boards with DSS enabled in bootloader.

I can ack this patch as a concept. The dss_core has to be initialized before other dss hw modules. I can't say if the implementation here is good or not, I don't know enough about hwmod.

Paul?

Tomi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120112/3af45e9a/attachment.sig>

maintainer
#6 lore raw

PATCH v2 1/1 OMAP3: hwmod_data: register dss hwmods after dss_core

In reply to Ilya Yanok
Quoted 8 lines · Ilya Yanok

dss_core has to be initialized before any other DSS hwmod. Currently this is broken as dss_core is listed in chip/revision specific hwmod lists while other DSS hwmods are listed in common list which is registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list which is registered last to ensure that dss_core is already registered.

Quoted 7 lines

This solves the problem with BUG() in L3 interrupt handler on boards with DSS enabled in bootloader.

CC Tomi Valkeinen <[email protected]>
CC Archit Taneja <[email protected]>
CC Paul Walmsley <[email protected]>

Thanks Ilya, queued for 3.3-rc.

- Paul