All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: onramp123@yahoo.com
Cc: linuxppc-dev@ozlabs.org
Subject: RE: mpc8349e-mitx 2.6.25 serial IRQ assigned wrong
Date: Thu, 05 Mar 2009 00:00:20 +1100	[thread overview]
Message-ID: <1236171620.8267.20.camel@localhost> (raw)
In-Reply-To: <025a01c99c8b$90afb030$6b03a8c0@sdelaney2>

[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]

On Tue, 2009-03-03 at 21:39 -0800, Steve DeLaney wrote:
> 
> Here's an update on this issue.  
> 
> After verifying the device tree was OK, the OF traces led us to the root
> cause.
> 
> powerpc irq.c irq_alloc_virt() assigns a virtual IRQ as a function of the
> input hardware IRQ hint, AND NUM_ISA_INTERRUPTS.  it turns out that
> asm-ppc/irq.h defines NUM_ISA_INTERRUPTS 16, so that the allocated virq
> is offset by this amount.  this accounts for the remap shown below for 
> i2c and serial device vectors.
> 
> I didn't realize before that /proc/interrupts 
> serviced by irq.c show_interrupts() displays virtual vector numbers.
> 
> For the mpc8349e-mitx this must be incorrect since there is no ISA?
> Essentially all that is needed is a 1:1 mapping hirq:virq since
> each interrupt source in the system appears to have a unique vector
> in the SOC IPIC.  It seems this scheme is needlessly complex, at least for
> mpc8349e.
> 
> For now we simply define irq.h NUM_ISA_INTERRUPTS 0
> but this isn't a complete solution since our PCI device
> interrupt on hirq 20, ends up allocated on virq 1.  To force
> this to work, the driver does an irq_create_mapping(NULL, 20),
> then assigns its own dev->irq=20 before calling request_irq()
> 
> I'm sure someone has a more elegant solution but that's what
> we've been able to come up with so far.

I'm not clear on what the problem is.

The interrupt numbers in /proc/interrupts will no longer match what the
old kernel had, because as you mention the values in /proc/interrupts
are virtual irqs.

If you want to see the mapping turn on CONFIG_VIRQ_DEBUG and you'll get
a file in debugfs called virq_mapping that shows the details.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-03-04 13:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04  5:39 mpc8349e-mitx 2.6.25 serial IRQ assigned wrong Steve DeLaney
2009-03-04 13:00 ` Michael Ellerman [this message]
2009-03-04 22:21 ` Timur Tabi
2009-03-04 23:08 ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2009-02-27 12:54 Can't load module spi_mpc83xx : No such device Anton Vorontsov
2009-02-28 16:07 ` mpc8349e-mitx 2.6.25 serial IRQ assigned wrong Steve DeLaney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236171620.8267.20.camel@localhost \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=onramp123@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.