public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: sun7i/sun6i: Fix broken kernel on sun6i/A31
@ 2014-03-27 17:02 Carlo Caione
  2014-03-27 17:02 ` [PATCH 1/2] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller Carlo Caione
  2014-03-27 17:02 ` [PATCH 2/2] ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler Carlo Caione
  0 siblings, 2 replies; 5+ messages in thread
From: Carlo Caione @ 2014-03-27 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

These fixes are proposed by Hans de Goede to fix the broken kernel on
sun6i/A31. The major problem is that the IRQ number for NMI on sun6i is wrong.
Besides that, Hans proposed a fix to avoid having sporious interrupts when the
NMI line is asserted but no driver has claimed the downstream interrupt of the
NMI.

Hans de Goede (2):
  ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller
  ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler

 arch/arm/boot/dts/sun6i-a31.dtsi | 2 +-
 drivers/irqchip/irq-sunxi-nmi.c  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

-- 
1.8.4.1

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

* [PATCH 1/2] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller
  2014-03-27 17:02 [PATCH 0/2] ARM: sun7i/sun6i: Fix broken kernel on sun6i/A31 Carlo Caione
@ 2014-03-27 17:02 ` Carlo Caione
  2014-03-31 11:02   ` Maxime Ripard
  2014-03-27 17:02 ` [PATCH 2/2] ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler Carlo Caione
  1 sibling, 1 reply; 5+ messages in thread
From: Carlo Caione @ 2014-03-27 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Hans de Goede <hdegoede@redhat.com>

The IRQ line used in sun6i-a31.dtsi for the NMI controller is wrong.
This causes a IRQ storm since the NMI controller is repeatedly fired.
This patch fixes this problem assigning the correct IRQ number to the
NMI controller.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlo Caione <carlo@caione.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 3b95cb5..38d43fe 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -195,7 +195,7 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;
 			reg = <0x01f00c0c 0x38>;
-			interrupts = <0 0 4>;
+			interrupts = <0 32 4>;
 		};
 
 		pio: pinctrl at 01c20800 {
-- 
1.8.4.1

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

* [PATCH 2/2] ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler
  2014-03-27 17:02 [PATCH 0/2] ARM: sun7i/sun6i: Fix broken kernel on sun6i/A31 Carlo Caione
  2014-03-27 17:02 ` [PATCH 1/2] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller Carlo Caione
@ 2014-03-27 17:02 ` Carlo Caione
  2014-03-31 11:06   ` Maxime Ripard
  1 sibling, 1 reply; 5+ messages in thread
From: Carlo Caione @ 2014-03-27 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Hans de Goede <hdegoede@redhat.com>

It is advisable to disable the NMI before registering the IRQ handler as
registering the IRQ handler unmasks the IRQ on the GIC, so if U-Boot has
left the NMI enabled and the NMI pin is active we will immediately get
an interrupt before any driver has claimed the downstream interrupt of
the NMI.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlo Caione <carlo@caione.org>
---
 drivers/irqchip/irq-sunxi-nmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c
index 1c8566c..12f547a 100644
--- a/drivers/irqchip/irq-sunxi-nmi.c
+++ b/drivers/irqchip/irq-sunxi-nmi.c
@@ -179,12 +179,12 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 	gc->chip_types[1].regs.type		= reg_offs->ctrl;
 	gc->chip_types[1].handler		= handle_edge_irq;
 
-	irq_set_handler_data(irq, domain);
-	irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);
-
 	sunxi_sc_nmi_write(gc, reg_offs->enable, 0);
 	sunxi_sc_nmi_write(gc, reg_offs->pend, 0x1);
 
+	irq_set_handler_data(irq, domain);
+	irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);
+
 	return 0;
 
 fail_irqd_remove:
-- 
1.8.4.1

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

* [PATCH 1/2] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller
  2014-03-27 17:02 ` [PATCH 1/2] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller Carlo Caione
@ 2014-03-31 11:02   ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2014-03-31 11:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 27, 2014 at 06:02:38PM +0100, Carlo Caione wrote:
> From: Hans de Goede <hdegoede@redhat.com>
> 
> The IRQ line used in sun6i-a31.dtsi for the NMI controller is wrong.
> This causes a IRQ storm since the NMI controller is repeatedly fired.
> This patch fixes this problem assigning the correct IRQ number to the
> NMI controller.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Carlo Caione <carlo@caione.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140331/ce3c2f12/attachment-0001.sig>

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

* [PATCH 2/2] ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler
  2014-03-27 17:02 ` [PATCH 2/2] ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler Carlo Caione
@ 2014-03-31 11:06   ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2014-03-31 11:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 27, 2014 at 06:02:39PM +0100, Carlo Caione wrote:
> From: Hans de Goede <hdegoede@redhat.com>
> 
> It is advisable to disable the NMI before registering the IRQ handler as
> registering the IRQ handler unmasks the IRQ on the GIC, so if U-Boot has
> left the NMI enabled and the NMI pin is active we will immediately get
> an interrupt before any driver has claimed the downstream interrupt of
> the NMI.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Carlo Caione <carlo@caione.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140331/ece0e7d5/attachment.sig>

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

end of thread, other threads:[~2014-03-31 11:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 17:02 [PATCH 0/2] ARM: sun7i/sun6i: Fix broken kernel on sun6i/A31 Carlo Caione
2014-03-27 17:02 ` [PATCH 1/2] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller Carlo Caione
2014-03-31 11:02   ` Maxime Ripard
2014-03-27 17:02 ` [PATCH 2/2] ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler Carlo Caione
2014-03-31 11:06   ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox