All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices
@ 2015-05-21 19:00 Lennart Sorensen
  2015-05-21 19:04 ` Lennart Sorensen
  2015-05-21 21:55 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 5+ messages in thread
From: Lennart Sorensen @ 2015-05-21 19:00 UTC (permalink / raw)
  To: xenomai

Complex arm devices like the TI AM572x have IRQ crossbars that can make
interrupt numbers map to just about anything you want.  This means that
the value of d->irq and d->hwirq do not have to have anything to do with
each other.  The unpatched kernel uses the inline function gic_irq() to
get this mapping, rather than d->irq.  Restore the code to the unpatched
kernel state, and update the ipipe gic_hold_irq/gic_release_irq functions
to use gic_irq() too.

This fixes booting with 3.14.39 on the TI AM572x.

Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
---
 drivers/irqchip/irq-gic.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 7a68905..c4ff114 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -155,7 +155,7 @@ static inline unsigned int gic_irq(struct irq_data *d)
  */
 static void gic_mask_irq(struct irq_data *d)
 {
-	u32 mask = 1 << (d->irq % 32);
+	u32 mask = 1 << (gic_irq(d) % 32);
 	unsigned long flags;
 
 	raw_spin_lock_irqsave_cond(&irq_controller_lock, flags);
@@ -168,7 +168,7 @@ static void gic_mask_irq(struct irq_data *d)
 
 static void gic_unmask_irq(struct irq_data *d)
 {
-	u32 mask = 1 << (d->irq % 32);
+	u32 mask = 1 << (gic_irq(d) % 32);
 	unsigned long flags;
 
 	raw_spin_lock_irqsave_cond(&irq_controller_lock, flags);
@@ -195,7 +195,7 @@ static void gic_eoi_irq(struct irq_data *d)
 
 static void gic_hold_irq(struct irq_data *d)
 {
-	u32 mask = 1 << (d->irq % 32);
+	u32 mask = 1 << (gic_irq(d) % 32);
 	unsigned long flags;
 
 	raw_spin_lock_irqsave_cond(&irq_controller_lock, flags);
@@ -211,7 +211,7 @@ static void gic_hold_irq(struct irq_data *d)
 
 static void gic_release_irq(struct irq_data *d)
 {
-	u32 mask = 1 << (d->irq % 32);
+	u32 mask = 1 << (gic_irq(d) % 32);
 	unsigned long flags;
 
 	raw_spin_lock_irqsave_cond(&irq_controller_lock, flags);
-- 
1.7.10.4


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

* Re: [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices
  2015-05-21 19:00 [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices Lennart Sorensen
@ 2015-05-21 19:04 ` Lennart Sorensen
  2015-05-21 21:55 ` Gilles Chanteperdrix
  1 sibling, 0 replies; 5+ messages in thread
From: Lennart Sorensen @ 2015-05-21 19:04 UTC (permalink / raw)
  To: xenomai

On Thu, May 21, 2015 at 03:00:24PM -0400, Lennart Sorensen wrote:
> Complex arm devices like the TI AM572x have IRQ crossbars that can make
> interrupt numbers map to just about anything you want.  This means that
> the value of d->irq and d->hwirq do not have to have anything to do with
> each other.  The unpatched kernel uses the inline function gic_irq() to
> get this mapping, rather than d->irq.  Restore the code to the unpatched
> kernel state, and update the ipipe gic_hold_irq/gic_release_irq functions
> to use gic_irq() too.
> 
> This fixes booting with 3.14.39 on the TI AM572x.

This applies cleanly to ipipe-3.14 and ipipe-3.16 and with a 1 line
offset to ipipe-3.18 and master.

-- 
Len Sorensen


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

* Re: [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices
  2015-05-21 19:00 [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices Lennart Sorensen
  2015-05-21 19:04 ` Lennart Sorensen
@ 2015-05-21 21:55 ` Gilles Chanteperdrix
  2015-05-22 13:59   ` Lennart Sorensen
  1 sibling, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2015-05-21 21:55 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: xenomai

On Thu, May 21, 2015 at 03:00:24PM -0400, Lennart Sorensen wrote:
> Complex arm devices like the TI AM572x have IRQ crossbars that can make
> interrupt numbers map to just about anything you want.

The difference between d->hwirq and d->irq has nothing to do with
any crossbar. It is simply a relatively recent evolution of the
Linux kernel where the space for software interrupts is separated
from the space for hardware interrupts. Not all interrupt
controllers have been converted from a version to the next, so the
I-pipe patch has to play catch-up with each version converting more
interrupt controllers. Business as usual.

-- 
					    Gilles.


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

* Re: [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices
  2015-05-21 21:55 ` Gilles Chanteperdrix
@ 2015-05-22 13:59   ` Lennart Sorensen
  2015-05-24  6:48     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 5+ messages in thread
From: Lennart Sorensen @ 2015-05-22 13:59 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On Thu, May 21, 2015 at 11:55:53PM +0200, Gilles Chanteperdrix wrote:
> On Thu, May 21, 2015 at 03:00:24PM -0400, Lennart Sorensen wrote:
> > Complex arm devices like the TI AM572x have IRQ crossbars that can make
> > interrupt numbers map to just about anything you want.
> 
> The difference between d->hwirq and d->irq has nothing to do with
> any crossbar. It is simply a relatively recent evolution of the
> Linux kernel where the space for software interrupts is separated
> from the space for hardware interrupts. Not all interrupt
> controllers have been converted from a version to the next, so the
> I-pipe patch has to play catch-up with each version converting more
> interrupt controllers. Business as usual.

OK.  Want an update with a simpler commit message, or will you clean
it up?

-- 
Len Sorensen


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

* Re: [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices
  2015-05-22 13:59   ` Lennart Sorensen
@ 2015-05-24  6:48     ` Gilles Chanteperdrix
  0 siblings, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2015-05-24  6:48 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: xenomai

On Fri, May 22, 2015 at 09:59:48AM -0400, Lennart Sorensen wrote:
> On Thu, May 21, 2015 at 11:55:53PM +0200, Gilles Chanteperdrix wrote:
> > On Thu, May 21, 2015 at 03:00:24PM -0400, Lennart Sorensen wrote:
> > > Complex arm devices like the TI AM572x have IRQ crossbars that can make
> > > interrupt numbers map to just about anything you want.
> > 
> > The difference between d->hwirq and d->irq has nothing to do with
> > any crossbar. It is simply a relatively recent evolution of the
> > Linux kernel where the space for software interrupts is separated
> > from the space for hardware interrupts. Not all interrupt
> > controllers have been converted from a version to the next, so the
> > I-pipe patch has to play catch-up with each version converting more
> > interrupt controllers. Business as usual.
> 
> OK.  Want an update with a simpler commit message, or will you clean
> it up?

Please update.

-- 
					    Gilles.


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

end of thread, other threads:[~2015-05-24  6:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 19:00 [Xenomai] [PATCH] Fix arm GIC irq mask calculations on complex arm devices Lennart Sorensen
2015-05-21 19:04 ` Lennart Sorensen
2015-05-21 21:55 ` Gilles Chanteperdrix
2015-05-22 13:59   ` Lennart Sorensen
2015-05-24  6:48     ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.