linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Scott Wood" <scottwood@freescale.com>
Cc: linuxppc-dev <Linuxppc-dev@ozlabs.org>,
	Roland Dreier <rdreier@cisco.com>
Subject: Re: demuxing irqs
Date: Tue, 16 Sep 2008 19:47:31 -0400	[thread overview]
Message-ID: <9e4733910809161647l4af51794m7644ce3f63b87697@mail.gmail.com> (raw)
In-Reply-To: <20080916232429.GB15002@ld0162-tx32.am.freescale.net>

On Tue, Sep 16, 2008 at 7:24 PM, Scott Wood <scottwood@freescale.com> wrote:
> On Tue, Sep 16, 2008 at 06:08:34PM -0400, Jon Smirl wrote:
>> You have to map between GPIO and IRQ inside the interrupt handlers so
>> it has to be reasonably fast. This gets done on every shared interrupt
>> so you will end up building mapping tables. Also, gpio_to_irq()
>> doesn't take the gpio chip struct as a parameter.
>
> Well, that sucks.  We should be removing magic global numberspaces, not
> adding them.
>
>> Why does this mess with all of ther GPIO controllers? If they generate
>> interrupts they obviously have to coordinate with the VIRQ system.
>
> And if they don't generate interrupts, and they decide they can also
> just park themselves at MAX_IRQ?

More coordination has to be going on here, as far as I can tell
gpiolib has a built in assumption that all gpios in a system are
uniquely numbered.  I guess that since most systems can't dynamically
add GPIO the problem hasn't been addressed.

It could be fixed by creating a function for obtaining the max gpio id
in use and then using it as a base for any that are added later. The
core complain here is: what happens if you assign non-interrupting
GPIOs to 1-8 which are also hardware IRQs and then use irq functions
on these non-interrupting GPIO ids. My answer to that is don't assign
GPIO ids that are legal hardware interrupts. The function for
determing max GPIO ID in use may even exist in the ARM code, I haven't
gone looking for it.

In the mpc5200 most (maybe all?)  GPIOs are capable of being an
interrupt source so a 1:1 mapping with VIRQs is the natural solution.

mpc5200_pic.h reserves 208 spots for hardware interrupts. I don't know
why, there aren't that many possible. There are 56 GPIO pins, so you
end up with 264 virqs total. PowerPC defaults to 512 virqs available.



-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2008-09-16 23:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-13 19:06 demuxing irqs Jon Smirl
2008-09-13 22:41 ` Roland Dreier
2008-09-13 22:54   ` Jon Smirl
2008-09-13 23:04     ` Roland Dreier
2008-09-13 23:23       ` Jon Smirl
2008-09-14 14:06         ` Jon Smirl
2008-09-14 23:25           ` Jon Smirl
2008-09-15  3:06             ` Jon Smirl
2008-09-16 12:17               ` Anton Vorontsov
2008-09-16 12:37                 ` Jon Smirl
2008-09-16 13:12                   ` Anton Vorontsov
2008-09-16 13:36                     ` Jon Smirl
2008-09-16 14:14                       ` Anton Vorontsov
2008-09-16 14:24                         ` Jon Smirl
2008-09-16 17:49                           ` Scott Wood
2008-09-16 18:32                             ` Jon Smirl
2008-09-16 21:42                               ` Anton Vorontsov
2008-09-16 22:08                                 ` Jon Smirl
2008-09-16 23:24                                   ` Scott Wood
2008-09-16 23:47                                     ` Jon Smirl [this message]
2008-09-17 12:56                                   ` Anton Vorontsov
2008-09-17 14:09                                     ` Jon Smirl
2008-09-17 17:54                                       ` Stephen Neuendorffer
2008-09-16 14:29                         ` Jon Smirl

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=9e4733910809161647l4af51794m7644ce3f63b87697@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=rdreier@cisco.com \
    --cc=scottwood@freescale.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 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).