Skip to contentSkip to conversation

ARM: sun7i/sun6i: Fix broken kernel on sun6i/A31

PATCH New Carlo Caione 3 participants 7 messages Mar 27, 2014 – Mar 31, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM: sun7i/sun6i: Fix broken kernel on sun6i/A31

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(-)
Signature · 1 line
1.8.4.1
#1 lore raw

PATCH 1/2 ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller

From: Hans de Goede <[email protected]>

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.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/sun6i-a31.dtsi +1 -1
index 3b95cb5..38d43fe 100644
@@ -195,7 +195,7 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;
 			reg = <0x01f00c0c 0x38>;
-			interrupts = <0 0 4>;
+			interrupts = <0 32 4>;
 		};
 
 		pio: pinctrl at 01c20800 {
Signature · 1 line
1.8.4.1
#2 lore raw

[tip:irq/core] ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller

ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller
Commit-ID:  536a44d4277709303755e6365a059f54f4aa5403
Gitweb:     http://git.kernel.org/tip/536a44d4277709303755e6365a059f54f4aa5403
Author:     Hans de Goede <[email protected]>
AuthorDate: Thu, 27 Mar 2014 18:02:38 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 31 Mar 2014 11:12:57 +0200

ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller

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.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/sun6i-a31.dtsi +1 -1
index eea6033..fbdf88f 100644
@@ -195,7 +195,7 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;
 			reg = <0x01f00c0c 0x38>;
-			interrupts = <0 0 4>;
+			interrupts = <0 32 4>;
 		};
 
 		pio: pinctrl@01c20800 {
#3 lore raw

PATCH 1/2 ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller

In reply to Carlo Caione
Quoted 9 lines · Carlo Caione

From: Hans de Goede <[email protected]>

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.

Thanks!
Maxime

Signature · 10 lines
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>
#4 lore raw

PATCH 2/2 ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler

In reply to Carlo Caione

From: Hans de Goede <[email protected]>

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.

---
 drivers/irqchip/irq-sunxi-nmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/irqchip/irq-sunxi-nmi.c +3 -3
index 1c8566c..12f547a 100644
@@ -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:
Signature · 1 line
1.8.4.1
#5 lore raw

[tip:irq/core] irqchip: sun7i/sun6i: Disable NMI before registering the handler

irqchip: sun7i/sun6i: Disable NMI before registering the handler
Commit-ID:  1b422ecd27866985b9f35d0d2b5ae6e9122dd4c0
Gitweb:     http://git.kernel.org/tip/1b422ecd27866985b9f35d0d2b5ae6e9122dd4c0
Author:     Hans de Goede <[email protected]>
AuthorDate: Thu, 27 Mar 2014 18:02:39 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 31 Mar 2014 11:12:57 +0200

irqchip: sun7i/sun6i: Disable NMI before registering the handler

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.

---
 drivers/irqchip/irq-sunxi-nmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/irqchip/irq-sunxi-nmi.c +3 -3
index 1c8566c..12f547a 100644
@@ -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:
#6 lore raw

PATCH 2/2 ARM: sun7i/sun6i: irqchip: Disable NMI before registering the handler

In reply to Carlo Caione
Quoted 10 lines · Carlo Caione

From: Hans de Goede <[email protected]>

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.

Thanks!

Signature · 10 lines
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>