linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
@ 2013-03-20 15:09 Gregory CLEMENT
  2013-03-20 15:37 ` Thomas Petazzoni
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Gregory CLEMENT @ 2013-03-20 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/mach-mvebu/irq-armada-370-xp.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-mvebu/irq-armada-370-xp.c b/arch/arm/mach-mvebu/irq-armada-370-xp.c
index 274ff58..6a9195e 100644
--- a/arch/arm/mach-mvebu/irq-armada-370-xp.c
+++ b/arch/arm/mach-mvebu/irq-armada-370-xp.c
@@ -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);
-- 
1.7.9.5

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 15:09 [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0 Gregory CLEMENT
@ 2013-03-20 15:37 ` Thomas Petazzoni
  2013-03-20 16:44 ` Ryan Press
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2013-03-20 15:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Wed, 20 Mar 2013 16:09:35 +0100, Gregory CLEMENT wrote:
> 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.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 (on Armada XP GP board)

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 15:09 [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0 Gregory CLEMENT
  2013-03-20 15:37 ` Thomas Petazzoni
@ 2013-03-20 16:44 ` Ryan Press
  2013-03-20 17:27   ` Thomas Petazzoni
  2013-03-21  2:19 ` Masami Hiramatsu
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Ryan Press @ 2013-03-20 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 20, 2013 at 8:09 AM, Gregory CLEMENT
<gregory.clement@free-electrons.com> wrote:
> 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.

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

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 16:44 ` Ryan Press
@ 2013-03-20 17:27   ` Thomas Petazzoni
  2013-03-20 23:57     ` Ryan Press
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2013-03-20 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Ryan Press,

On Wed, 20 Mar 2013 09:44:42 -0700, Ryan Press wrote:

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 17:27   ` Thomas Petazzoni
@ 2013-03-20 23:57     ` Ryan Press
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Press @ 2013-03-20 23:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thomas,

On Wed, Mar 20, 2013 at 10:27 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Ryan Press,
>
> On Wed, 20 Mar 2013 09:44:42 -0700, Ryan Press wrote:
>
>> 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).

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

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 15:09 [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0 Gregory CLEMENT
  2013-03-20 15:37 ` Thomas Petazzoni
  2013-03-20 16:44 ` Ryan Press
@ 2013-03-21  2:19 ` Masami Hiramatsu
  2013-03-26 16:00 ` Thomas Petazzoni
  2013-03-28 16:49 ` Jason Cooper
  4 siblings, 0 replies; 10+ messages in thread
From: Masami Hiramatsu @ 2013-03-21  2:19 UTC (permalink / raw)
  To: linux-arm-kernel

(2013/03/21 0:09), Gregory CLEMENT wrote:
> 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.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

Hi,

I've tested this too.

Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thank you!

-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt at hitachi.com

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 15:09 [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0 Gregory CLEMENT
                   ` (2 preceding siblings ...)
  2013-03-21  2:19 ` Masami Hiramatsu
@ 2013-03-26 16:00 ` Thomas Petazzoni
  2013-03-26 22:43   ` Jason Cooper
  2013-03-28 16:49 ` Jason Cooper
  4 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2013-03-26 16:00 UTC (permalink / raw)
  To: linux-arm-kernel

Jason, Andrew,

On Wed, 20 Mar 2013 16:09:35 +0100, Gregory CLEMENT wrote:
> 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.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-26 16:00 ` Thomas Petazzoni
@ 2013-03-26 22:43   ` Jason Cooper
  2013-03-27  6:48     ` Gregory CLEMENT
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Cooper @ 2013-03-26 22:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 26, 2013 at 05:00:51PM +0100, Thomas Petazzoni wrote:
> Jason, Andrew,
> 
> On Wed, 20 Mar 2013 16:09:35 +0100, Gregory CLEMENT wrote:
> > 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.
> > 
> > Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> 
> 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.

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-26 22:43   ` Jason Cooper
@ 2013-03-27  6:48     ` Gregory CLEMENT
  0 siblings, 0 replies; 10+ messages in thread
From: Gregory CLEMENT @ 2013-03-27  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/26/2013 11:43 PM, Jason Cooper wrote:
> On Tue, Mar 26, 2013 at 05:00:51PM +0100, Thomas Petazzoni wrote:
>> Jason, Andrew,
>>
>> On Wed, 20 Mar 2013 16:09:35 +0100, Gregory CLEMENT wrote:
>>> 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.
>>>
>>> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>>
>> 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

> Jason.
> 


-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0
  2013-03-20 15:09 [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0 Gregory CLEMENT
                   ` (3 preceding siblings ...)
  2013-03-26 16:00 ` Thomas Petazzoni
@ 2013-03-28 16:49 ` Jason Cooper
  4 siblings, 0 replies; 10+ messages in thread
From: Jason Cooper @ 2013-03-28 16:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 20, 2013 at 04:09:35PM +0100, Gregory CLEMENT wrote:
> 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.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  arch/arm/mach-mvebu/irq-armada-370-xp.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Applied to mvebu/fixes

thx,

Jason.

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

end of thread, other threads:[~2013-03-28 16:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 15:09 [PATCH for 3.9-rc] arm: mvebu: Use local interrupt only for the timer 0 Gregory CLEMENT
2013-03-20 15:37 ` Thomas Petazzoni
2013-03-20 16:44 ` Ryan Press
2013-03-20 17:27   ` Thomas Petazzoni
2013-03-20 23:57     ` Ryan Press
2013-03-21  2:19 ` Masami Hiramatsu
2013-03-26 16:00 ` Thomas Petazzoni
2013-03-26 22:43   ` Jason Cooper
2013-03-27  6:48     ` Gregory CLEMENT
2013-03-28 16:49 ` Jason Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).