All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: imx6: Warn when an old DT is detected
@ 2015-03-13 16:05 Marc Zyngier
  2015-03-13 17:39 ` Jason Cooper
  2015-03-16  8:07 ` Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Zyngier @ 2015-03-13 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the GPC has been converted to be a full blown irqchip
(and not a mole on the side of the GIC), booting a new kernel
with an old DT is likely to result in a rough ride for the user.

This patch makes sure such a situation is promptly detected and
the user made aware that a DT update is in order.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
* From v1:
- Moved the DT check as early as possible (reported by Shawn)

 arch/arm/mach-imx/common.h      |  1 +
 arch/arm/mach-imx/gpc.c         | 10 ++++++++++
 arch/arm/mach-imx/mach-imx6q.c  |  1 +
 arch/arm/mach-imx/mach-imx6sl.c |  1 +
 arch/arm/mach-imx/mach-imx6sx.c |  1 +
 5 files changed, 14 insertions(+)

diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index f22e400..aba6831 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -71,6 +71,7 @@ unsigned int imx_get_soc_revision(void);
 void imx_init_revision_from_anatop(void);
 struct device *imx_soc_device_init(void);
 void imx6_enable_rbc(bool enable);
+void imx_gpc_check_dt(void);
 void imx_gpc_set_arm_power_in_lpm(bool power_off);
 void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
 void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index db89c35..7017f02 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -249,3 +249,13 @@ static int __init imx_gpc_init(struct device_node *node,
  * drivers/irqchip, so we're forced to roll our own. Not very nice.
  */
 OF_DECLARE_2(irqchip, imx_gpc, "fsl,imx6q-gpc", imx_gpc_init);
+
+void __init imx_gpc_check_dt(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
+	if (WARN_ON(!np ||
+		    !of_find_property(np, "interrupt-controller", NULL)))
+		pr_warn("Outdated DT detected, system is about to crash!!!\n");
+}
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 6fc2b7e..e21a693 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -387,6 +387,7 @@ static void __init imx6q_map_io(void)
 
 static void __init imx6q_init_irq(void)
 {
+	imx_gpc_check_dt();
 	imx_init_revision_from_anatop();
 	imx_init_l2cache();
 	imx_src_init();
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
index d39c274..12a1b09 100644
--- a/arch/arm/mach-imx/mach-imx6sl.c
+++ b/arch/arm/mach-imx/mach-imx6sl.c
@@ -61,6 +61,7 @@ static void __init imx6sl_init_machine(void)
 
 static void __init imx6sl_init_irq(void)
 {
+	imx_gpc_check_dt();
 	imx_init_revision_from_anatop();
 	imx_init_l2cache();
 	imx_src_init();
diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 8595f9e..f17b700 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -81,6 +81,7 @@ static void __init imx6sx_init_machine(void)
 
 static void __init imx6sx_init_irq(void)
 {
+	imx_gpc_check_dt();
 	imx_init_revision_from_anatop();
 	imx_init_l2cache();
 	imx_src_init();
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] ARM: imx6: Warn when an old DT is detected
  2015-03-13 16:05 [PATCH v2] ARM: imx6: Warn when an old DT is detected Marc Zyngier
@ 2015-03-13 17:39 ` Jason Cooper
  2015-03-16  8:07 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Cooper @ 2015-03-13 17:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 13, 2015 at 04:05:37PM +0000, Marc Zyngier wrote:
> Now that the GPC has been converted to be a full blown irqchip
> (and not a mole on the side of the GIC), booting a new kernel
> with an old DT is likely to result in a rough ride for the user.
> 
> This patch makes sure such a situation is promptly detected and
> the user made aware that a DT update is in order.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks for doing this, Marc!

Acked-by: Jason Cooper <jason@lakedaemon.net>

thx,

Jason.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] ARM: imx6: Warn when an old DT is detected
  2015-03-13 16:05 [PATCH v2] ARM: imx6: Warn when an old DT is detected Marc Zyngier
  2015-03-13 17:39 ` Jason Cooper
@ 2015-03-16  8:07 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2015-03-16  8:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 13, 2015 at 04:05:37PM +0000, Marc Zyngier wrote:
> Now that the GPC has been converted to be a full blown irqchip
> (and not a mole on the side of the GIC), booting a new kernel
> with an old DT is likely to result in a rough ride for the user.
> 
> This patch makes sure such a situation is promptly detected and
> the user made aware that a DT update is in order.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-16  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 16:05 [PATCH v2] ARM: imx6: Warn when an old DT is detected Marc Zyngier
2015-03-13 17:39 ` Jason Cooper
2015-03-16  8:07 ` Shawn Guo

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.