diff mbox

[3.16.y-ckt,053/133] ARM: orion5x: fix legacy orion5x IRQ numbers

Message ID 1443606681-7124-54-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques Sept. 30, 2015, 9:50 a.m. UTC
3.16.7-ckt18 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Benjamin Cama <benoar@dolka.fr>

commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.

Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
Fix this by increasing all interrupts by one, as did 5d6bed2a9c8b for
dove. Also, force MULTI_IRQ_HANDLER for all orion platforms (including
dove) as the specific handler is needed to shift back IRQ numbers by
one.

[gregory.clement@free-electrons.com]: moved the select
MULTI_IRQ_HANDLER from PLAT_ORION_LEGACY to ARCH_ORION5X as it broke
the build for dove.

Fixes: a71b092a9c68 ("ARM: Convert handle_IRQ to use __handle_domain_irq")
Signed-off-by: Benjamin Cama <benoar@dolka.fr>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Detlef Vollmann <dv@vollmann.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/Kconfig                          |  1 +
 arch/arm/mach-orion5x/include/mach/irqs.h | 64 +++++++++++++++----------------
 arch/arm/mach-orion5x/irq.c               |  4 +-
 3 files changed, 35 insertions(+), 34 deletions(-)

Comments

Ben Hutchings Oct. 15, 2015, 3:23 a.m. UTC | #1
On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
> 3.16.7-ckt18 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Benjamin Cama <benoar@dolka.fr>
> 
> commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
> 
> Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
[...]

But I don't think this was needed for 3.16-ckt, was it?

Ben.
Gregory CLEMENT Oct. 15, 2015, 6:22 a.m. UTC | #2
Hi Ben and Luis,
 
 On jeu., oct. 15 2015, Ben Hutchings <ben@decadent.org.uk> wrote:

> On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
>> 3.16.7-ckt18 -stable review patch.  If anyone has any objections, please let me know.
>> 
>> ------------------
>> 
>> From: Benjamin Cama <benoar@dolka.fr>
>> 
>> commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
>> 
>> Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
> [...]
>
> But I don't think this was needed for 3.16-ckt, was it?

Indeed it fixes a commit (a71b092a9c68 ("ARM: Convert handle_IRQ to use
__handle_domain_irq")) that was introduced in 3.18:

git tag --contains a71b092a9c68 | grep "^v3\." | sort | head -1
v3.18

So please Luis do not apply it on 3.16-ckt unless you already back port
the commit a71b092a9c68 ("ARM: Convert handle_IRQ to use
__handle_domain_irq") on this branch.

Thanks,

Gregory

>
> Ben.
>
> -- 
> Ben Hutchings
> Who are all these weirdos? - David Bowie, reading IRC for the first time
Benjamin Cama Oct. 15, 2015, 9:03 a.m. UTC | #3
Hi everyone,

Le 2015-10-15 08:22, Gregory CLEMENT a écrit :
>  On jeu., oct. 15 2015, Ben Hutchings <ben@decadent.org.uk> wrote:
>
>> On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
>>> 3.16.7-ckt18 -stable review patch.  If anyone has any objections, 
>>> please let me know.
>>>
>>> ------------------
>>>
>>> From: Benjamin Cama <benoar@dolka.fr>
>>>
>>> commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
>>>
>>> Since v3.18, attempts to deliver IRQ0 are rejected, breaking 
>>> orion5x.
>> [...]
>>
>> But I don't think this was needed for 3.16-ckt, was it?
>
> Indeed it fixes a commit (a71b092a9c68 ("ARM: Convert handle_IRQ to 
> use
> __handle_domain_irq")) that was introduced in 3.18:
>
> git tag --contains a71b092a9c68 | grep "^v3\." | sort | head -1
> v3.18
>
> So please Luis do not apply it on 3.16-ckt unless you already back 
> port
> the commit a71b092a9c68 ("ARM: Convert handle_IRQ to use
> __handle_domain_irq") on this branch.

Indeed it is not completely needed, but to be clear it "just" shifts 
the IRQs by one, so it shouldn't do any harm either. So it is up to you. 
I would understand that you choose not to apply it to be on the safe 
side. BTW, it seems f28d7de is required by my patch, appearing in 3.14; 
as I don't follow kernel development closely, I could not assure you my 
patch is completly safe for 3.16.

Regards,
--
benjamin
Luis Henriques Oct. 19, 2015, 8:39 a.m. UTC | #4
On Thu, Oct 15, 2015 at 11:03:19AM +0200, Benjamin Cama wrote:
> Hi everyone,
> 
> Le 2015-10-15 08:22, Gregory CLEMENT a écrit :
> > On jeu., oct. 15 2015, Ben Hutchings <ben@decadent.org.uk> wrote:
> >
> >>On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
> >>>3.16.7-ckt18 -stable review patch.  If anyone has any objections,
> >>>please let me know.
> >>>
> >>>------------------
> >>>
> >>>From: Benjamin Cama <benoar@dolka.fr>
> >>>
> >>>commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
> >>>
> >>>Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
> >>[...]
> >>
> >>But I don't think this was needed for 3.16-ckt, was it?
> >
> >Indeed it fixes a commit (a71b092a9c68 ("ARM: Convert handle_IRQ to use
> >__handle_domain_irq")) that was introduced in 3.18:
> >
> >git tag --contains a71b092a9c68 | grep "^v3\." | sort | head -1
> >v3.18
> >
> >So please Luis do not apply it on 3.16-ckt unless you already back port
> >the commit a71b092a9c68 ("ARM: Convert handle_IRQ to use
> >__handle_domain_irq") on this branch.
> 
> Indeed it is not completely needed, but to be clear it "just" shifts the
> IRQs by one, so it shouldn't do any harm either. So it is up to you. I would
> understand that you choose not to apply it to be on the safe side. BTW, it
> seems f28d7de is required by my patch, appearing in 3.14; as I don't follow
> kernel development closely, I could not assure you my patch is completly
> safe for 3.16.
>

*Sigh*
Sorry for letting this commit getting in.  I'm reverting it for the next
3.16 kernel release.  Thank you all!

Cheers,
--
Luís
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 290f02ee0157..f32418a0cd18 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -565,6 +565,7 @@  config ARCH_ORION5X
 	select MVEBU_MBUS
 	select PCI
 	select PLAT_ORION_LEGACY
+	select MULTI_IRQ_HANDLER
 	help
 	  Support for the following Marvell Orion 5x series SoCs:
 	  Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
diff --git a/arch/arm/mach-orion5x/include/mach/irqs.h b/arch/arm/mach-orion5x/include/mach/irqs.h
index a6fa9d8f12d8..2431d9923427 100644
--- a/arch/arm/mach-orion5x/include/mach/irqs.h
+++ b/arch/arm/mach-orion5x/include/mach/irqs.h
@@ -16,42 +16,42 @@ 
 /*
  * Orion Main Interrupt Controller
  */
-#define IRQ_ORION5X_BRIDGE		0
-#define IRQ_ORION5X_DOORBELL_H2C	1
-#define IRQ_ORION5X_DOORBELL_C2H	2
-#define IRQ_ORION5X_UART0		3
-#define IRQ_ORION5X_UART1		4
-#define IRQ_ORION5X_I2C			5
-#define IRQ_ORION5X_GPIO_0_7		6
-#define IRQ_ORION5X_GPIO_8_15		7
-#define IRQ_ORION5X_GPIO_16_23		8
-#define IRQ_ORION5X_GPIO_24_31		9
-#define IRQ_ORION5X_PCIE0_ERR		10
-#define IRQ_ORION5X_PCIE0_INT		11
-#define IRQ_ORION5X_USB1_CTRL		12
-#define IRQ_ORION5X_DEV_BUS_ERR		14
-#define IRQ_ORION5X_PCI_ERR		15
-#define IRQ_ORION5X_USB_BR_ERR		16
-#define IRQ_ORION5X_USB0_CTRL		17
-#define IRQ_ORION5X_ETH_RX		18
-#define IRQ_ORION5X_ETH_TX		19
-#define IRQ_ORION5X_ETH_MISC		20
-#define IRQ_ORION5X_ETH_SUM		21
-#define IRQ_ORION5X_ETH_ERR		22
-#define IRQ_ORION5X_IDMA_ERR		23
-#define IRQ_ORION5X_IDMA_0		24
-#define IRQ_ORION5X_IDMA_1		25
-#define IRQ_ORION5X_IDMA_2		26
-#define IRQ_ORION5X_IDMA_3		27
-#define IRQ_ORION5X_CESA		28
-#define IRQ_ORION5X_SATA		29
-#define IRQ_ORION5X_XOR0		30
-#define IRQ_ORION5X_XOR1		31
+#define IRQ_ORION5X_BRIDGE		(1 + 0)
+#define IRQ_ORION5X_DOORBELL_H2C	(1 + 1)
+#define IRQ_ORION5X_DOORBELL_C2H	(1 + 2)
+#define IRQ_ORION5X_UART0		(1 + 3)
+#define IRQ_ORION5X_UART1		(1 + 4)
+#define IRQ_ORION5X_I2C			(1 + 5)
+#define IRQ_ORION5X_GPIO_0_7		(1 + 6)
+#define IRQ_ORION5X_GPIO_8_15		(1 + 7)
+#define IRQ_ORION5X_GPIO_16_23		(1 + 8)
+#define IRQ_ORION5X_GPIO_24_31		(1 + 9)
+#define IRQ_ORION5X_PCIE0_ERR		(1 + 10)
+#define IRQ_ORION5X_PCIE0_INT		(1 + 11)
+#define IRQ_ORION5X_USB1_CTRL		(1 + 12)
+#define IRQ_ORION5X_DEV_BUS_ERR		(1 + 14)
+#define IRQ_ORION5X_PCI_ERR		(1 + 15)
+#define IRQ_ORION5X_USB_BR_ERR		(1 + 16)
+#define IRQ_ORION5X_USB0_CTRL		(1 + 17)
+#define IRQ_ORION5X_ETH_RX		(1 + 18)
+#define IRQ_ORION5X_ETH_TX		(1 + 19)
+#define IRQ_ORION5X_ETH_MISC		(1 + 20)
+#define IRQ_ORION5X_ETH_SUM		(1 + 21)
+#define IRQ_ORION5X_ETH_ERR		(1 + 22)
+#define IRQ_ORION5X_IDMA_ERR		(1 + 23)
+#define IRQ_ORION5X_IDMA_0		(1 + 24)
+#define IRQ_ORION5X_IDMA_1		(1 + 25)
+#define IRQ_ORION5X_IDMA_2		(1 + 26)
+#define IRQ_ORION5X_IDMA_3		(1 + 27)
+#define IRQ_ORION5X_CESA		(1 + 28)
+#define IRQ_ORION5X_SATA		(1 + 29)
+#define IRQ_ORION5X_XOR0		(1 + 30)
+#define IRQ_ORION5X_XOR1		(1 + 31)
 
 /*
  * Orion General Purpose Pins
  */
-#define IRQ_ORION5X_GPIO_START	32
+#define IRQ_ORION5X_GPIO_START	33
 #define NR_GPIO_IRQS		32
 
 #define NR_IRQS			(IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c
index cd4bac4d7e43..086ecb87d885 100644
--- a/arch/arm/mach-orion5x/irq.c
+++ b/arch/arm/mach-orion5x/irq.c
@@ -42,7 +42,7 @@  __exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs)
 	stat = readl_relaxed(MAIN_IRQ_CAUSE);
 	stat &= readl_relaxed(MAIN_IRQ_MASK);
 	if (stat) {
-		unsigned int hwirq = __fls(stat);
+		unsigned int hwirq = 1 + __fls(stat);
 		handle_IRQ(hwirq, regs);
 		return;
 	}
@@ -51,7 +51,7 @@  __exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs)
 
 void __init orion5x_init_irq(void)
 {
-	orion_irq_init(0, MAIN_IRQ_MASK);
+	orion_irq_init(1, MAIN_IRQ_MASK);
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
 	set_handle_irq(orion5x_legacy_handle_irq);