linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: avorontsov@ru.mvista.com
Cc: Scott Wood <scottwood@freescale.com>,
	linuxppc-dev <Linuxppc-dev@ozlabs.org>,
	Roland Dreier <rdreier@cisco.com>
Subject: Re: demuxing irqs
Date: Tue, 16 Sep 2008 18:08:34 -0400	[thread overview]
Message-ID: <9e4733910809161508m3a94baf1g818be7247439848e@mail.gmail.com> (raw)
In-Reply-To: <20080916214210.GA15987@oksana.dev.rtsoft.ru>

On Tue, Sep 16, 2008 at 5:42 PM, Anton Vorontsov
<avorontsov@ru.mvista.com> wrote:
> On Tue, Sep 16, 2008 at 02:32:45PM -0400, Jon Smirl wrote:
>> On Tue, Sep 16, 2008 at 1:49 PM, Scott Wood <scottwood@freescale.com> wrote:
>> > On Tue, Sep 16, 2008 at 10:24:35AM -0400, Jon Smirl wrote:
>> >> On Tue, Sep 16, 2008 at 10:14 AM, Anton Vorontsov
>> >> <avorontsov@ru.mvista.com> wrote:
>> >> > Assume that GPIO 8 does not translate to any IRQ, but IRQ 8 is still
>> >> > valid virq b/c it is mapped for another IRQ controller (particularly
>> >> > lots of kernel code assumes that IRQ 8 is 8259 PIC's CMOS interrupt,
>> >> > the PIC and IRQ8 is widely used on PowerPC).
>> >>
>> >> Set the base in the GPIO struct such that this won't happen.  You can
>> >> set the base greater than MAX_IRQ.
>> >
>> > And then you'll conflict with some other subsystem that decides to engage
>> > in the same shenanigans.
>>
>> That comment was target at GPIO's that don't support interrupts. Give
>> those GPIO numbers greater than MAX_IRQ in case someone tries to use
>> them with the IRQ subsystem. Then they'll get errors.
>
> Or we can do the right thing, without messing all other gpio
> controllers, i.e. implementing MAX_IRQ hacks. Right?
>
> I still don't see any problems with .to_irq callback, can you
> point out any?


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.

Why does this mess with all of ther GPIO controllers? If they generate
interrupts they obviously have to coordinate with the VIRQ system.
This may be an issue with the way gpio lib is designed, the API for
the library assumes all gpios in the system are assigned unique
identifiers.

Is there any other problem with 1:1 other than it doesn't return an
error if gpio_to_irq() is called with a gpio number that doesn't
support irqs? You could always implement gpio_to_irq() like this:

if (gpio < MAX_HW_IRQ)
   return -ENOSYSl
return gpio;

Sure your proposal works too, it's just more complicated. 1:1 mapping
is working for ARM, why does PowerPC need to be different? I initially
started coding it the way you propose but then I stumbled across the
ARM solution and it was way simpler.


-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2008-09-16 22:08 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 [this message]
2008-09-16 23:24                                   ` Scott Wood
2008-09-16 23:47                                     ` Jon Smirl
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=9e4733910809161508m3a94baf1g818be7247439848e@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=avorontsov@ru.mvista.com \
    --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).