Skip to contentSkip to conversation

arm: mvebu: Use local interrupt only for the timer 0

PATCH New Gregory CLEMENT 5 participants 10 messages Mar 20, 2013 – Mar 28, 2013

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

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

---
 arch/arm/mach-mvebu/irq-armada-370-xp.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-mvebu/irq-armada-370-xp.c +5 -3
index 274ff58..6a9195e 100644
@@ -44,6 +44,8 @@
 
 #define ARMADA_370_XP_MAX_PER_CPU_IRQS		(28)
 
+#define ARMADA_370_XP_TIMER0_PER_CPU_IRQ	(5)
+
 #define ACTIVE_DOORBELLS			(8)
 
 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
@@ -62,7 +64,7 @@ static void armada_370_xp_irq_mask(struct irq_data *d)
 #ifdef CONFIG_SMP
 	irq_hw_number_t hwirq = irqd_to_hwirq(d);
 
-	if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS)
+	if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
 		writel(hwirq, main_int_base +
 				ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS);
 	else
@@ -79,7 +81,7 @@ static void armada_370_xp_irq_unmask(struct irq_data *d)
 #ifdef CONFIG_SMP
 	irq_hw_number_t hwirq = irqd_to_hwirq(d);
 
-	if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS)
+	if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
 		writel(hwirq, main_int_base +
 				ARMADA_370_XP_INT_SET_ENABLE_OFFS);
 	else
@@ -147,7 +149,7 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
 	writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
 	irq_set_status_flags(virq, IRQ_LEVEL);
 
-	if (hw < ARMADA_370_XP_MAX_PER_CPU_IRQS) {
+	if (hw == ARMADA_370_XP_TIMER0_PER_CPU_IRQ) {
 		irq_set_percpu_devid(virq);
 		irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
 					handle_percpu_devid_irq);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

Hello,

Quoted 14 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Quoted 1 line

(on Armada XP GP board)

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

In reply to Gregory CLEMENT
Quoted 6 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Quoted 7 lines

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Thanks Gregory!

I can confirm this patch works for me as well. I still have the problem on my Globalscale Mirabox where only a forced 10Mb link works on tx/rx. With 100Mb only rx works, and 1Gb neither works.

Ryan

#3 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

Dear Ryan Press,

Quoted 3 lines · Ryan Press

I can confirm this patch works for me as well. I still have the problem on my Globalscale Mirabox where only a forced 10Mb link works on tx/rx. With 100Mb only rx works, and 1Gb neither works.

Did you test both network interfaces? Do you have the problem on both? I know there are issues on the Mirabox with the network interface that wasn't initialized by U-Boot (i.e if you tftp your kernel from interface 0, interface 0 works fine in Linux but not interface 1, if your tftp your kernel from interface 1, it's the opposite).

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

Hi Thomas,

Quoted 8 lines · Thomas Petazzoni

Dear Ryan Press,

Quoted 3 lines · Ryan Press

I can confirm this patch works for me as well. I still have the problem on my Globalscale Mirabox where only a forced 10Mb link works on tx/rx. With 100Mb only rx works, and 1Gb neither works.

Quoted 5 lines

Did you test both network interfaces? Do you have the problem on both? I know there are issues on the Mirabox with the network interface that wasn't initialized by U-Boot (i.e if you tftp your kernel from interface 0, interface 0 works fine in Linux but not interface 1, if your tftp your kernel from interface 1, it's the opposite).

Ah, yes, so when I initialize the controller in U-Boot by attempting a tftp download (and then just ctrl-c out) before booting then I get 1Gb link. At first I suspected the PHY registers being different, but I dumped the registers when working vs non-working and they seemed the same, but hard to know for sure. Then I dumped some of the MAC registers and I see that 0x2410 is different, it shows that MVNETA_GMAC_RX_FLOW_CTRL_ENABLE and MVNETA_GMAC_TX_FLOW_CTRL_ENABLE (working 0x2c3b vs non-working 0x2401) bits are set when it is working. 0x2410 is just a status word and I don't know how to turn the flow control on otherwise, and probably there is more than this needed.

Thanks,
Ryan

#5 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

In reply to Gregory CLEMENT
Quoted 14 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Quoted 1 line

Hi,

I've tested this too.

Thank you!

Signature · 4 lines
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt at hitachi.com
#6 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

In reply to Gregory CLEMENT

Jason, Andrew,

Quoted 14 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Quoted 1 line

Would it be possible to get this commit pushed for 3.9-rc? Without it, the Marvell Armada 370/XP network interfaces are completely broken. The patch has been sent almost a week ago, and has received Tested-by from Ryan Press, Masami Hiramatsu and myself.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

Quoted 17 lines · Thomas Petazzoni

Jason, Andrew,

Quoted 14 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Quoted 6 lines
Quoted 1 line

Would it be possible to get this commit pushed for 3.9-rc? Without it, the Marvell Armada 370/XP network interfaces are completely broken. The patch has been sent almost a week ago, and has received Tested-by from Ryan Press, Masami Hiramatsu and myself.

It's in the queue, I just got a little behind.

thx,

Jason.

#8 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

Quoted 20 lines · Jason Cooper
Quoted 19 lines · Thomas Petazzoni

Jason, Andrew,

Quoted 15 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Quoted 9 lines
Quoted 4 lines

Would it be possible to get this commit pushed for 3.9-rc? Without it, the Marvell Armada 370/XP network interfaces are completely broken. The patch has been sent almost a week ago, and has received Tested-by from Ryan Press, Masami Hiramatsu and myself.

It's in the queue, I just got a little behind.

thx,

Thanks Jason

Quoted 2 lines

Jason.

Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
Applied
#9 lore raw

PATCH 1/1 arm: mvebu: Use local interrupt only for the timer 0

In reply to Gregory CLEMENT
Quoted 14 lines · Gregory CLEMENT

The commit 3a6f08a37 "arm: mvebu: Add support for local interrupt", managed the 28th first interrupts as local interrupt to match the hardware specification. Among these interrupts there are the Gigabits Ethernet ones used by the mvneta driver. Unfortunately the state of the percpu_irq API prevents the driver to use it.

Indeed the interrupts have to be freed when the .stop() function is called. As the free_percpu_irq() function don't disable the interrupt line, we have to do it on each CPU before calling this. The function disable_percpu_irq() only disable the percpu on the current CPU and there is no function which allows to disable a percpu irq on a given CPU. Waiting for the extension of the percpu_irq API, this fix allows to use again the mvneta driver.

Quoted 4 lines
---
 arch/arm/mach-mvebu/irq-armada-370-xp.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Applied to mvebu/fixes

thx,

Jason.