linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org, linux-pci@atrey.karlin.mff.cuni.cz,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 6/9] MPIC MSI allocator
Date: Thu, 14 Dec 2006 11:34:51 +1100	[thread overview]
Message-ID: <1166056491.6838.13.camel@concordia.ozlabs.ibm.com> (raw)
In-Reply-To: <20061213122353.7498a25e@pb15>

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

On Wed, 2006-12-13 at 12:23 -0600, Olof Johansson wrote:
> On Wed, 13 Dec 2006 21:40:03 +1100 Michael Ellerman <michael@ellerman.id.au> wrote:
> 
> > To support MSI on MPIC we need a way to reserve and allocate hardware irq
> > numbers, this patch implements an allocator for that. It looks like we'll
> > end up with several backends based on the MPIC, so the allocator is attached
> > to the struct mpic, not the msi backend.
> > 
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> 
> > +static void mpic_msi_auto_reserve_hwirqs(struct mpic *mpic)
> > +{
> > +	irq_hw_number_t hwirq;
> > +	struct irq_host_ops *ops = mpic->irqhost->ops;
> > +	struct device_node *np;
> > +	int flags, index, i;
> > +	struct of_irq oirq;
> > +
> > +	/* Reserve source numbers we know are reserved in the HW */
> 
> How do we know? Reserved on what HW? Sure looks system/platform
> dependent to me.

I agree. It's a fall-back position, we first check for the
"msi-available" property, and if that's not there we try to guess. New
firmwares should define "msi-available", but we don't want to wait for
that to happen, if it really bothers you we could have a
CONFIG_MPIC_MSI_DODGY_ALLOCATOR_GUESSING_ENABLE :)

So 0-7, 42-45 and 100-104 are known to be reserved on various revisions
of MPIC (and if there's more we can add them), and then we go through
the whole device tree and reserve anything that's already got an irq
mapped.

> 
> > +	for (i = 0;   i < 8;   i++)
> > +		__mpic_msi_reserve_hwirq(mpic, i);
> > +	for (i = 42;  i < 26;  i++)
>              ^^^^^^^^^^^^^^^
> 
> Is this some sort of check to see if we're awake? :)

Hehe. No it's proof that I wasn't awake when I wrote it, that's late
night hacking for you :)

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: 189 bytes --]

  parent reply	other threads:[~2006-12-14  0:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-13 10:39 [PATCH 0/9] Powerpc MSI Implementation (.. again) Michael Ellerman
2006-12-13 10:39 ` [PATCH 1/9] Add #defines for Hypertransport MSI fields Michael Ellerman
2006-12-13 10:39 ` [PATCH 2/9] Rip out the existing powerpc msi stubs Michael Ellerman
2006-12-13 10:39 ` [PATCH 3/9] Powerpc MSI implementation Michael Ellerman
2006-12-13 10:39 ` [PATCH 4/9] Enable MSI on Powerpc Michael Ellerman
2006-12-13 10:39 ` [PATCH 5/9] RTAS MSI implementation Michael Ellerman
2006-12-13 10:40 ` [PATCH 6/9] MPIC MSI allocator Michael Ellerman
2006-12-13 18:23   ` Olof Johansson
2006-12-13 23:25     ` Benjamin Herrenschmidt
2006-12-14  0:09       ` Olof Johansson
2006-12-14  0:32         ` Benjamin Herrenschmidt
2006-12-14  0:59           ` Michael Ellerman
2006-12-14  1:02             ` Benjamin Herrenschmidt
2006-12-14  1:06               ` Michael Ellerman
2006-12-14 14:46                 ` Segher Boessenkool
2006-12-14 19:44                   ` Benjamin Herrenschmidt
2006-12-15  1:47                     ` Segher Boessenkool
2006-12-15  1:51                       ` Michael Ellerman
2006-12-15  2:28                       ` Benjamin Herrenschmidt
2006-12-15  2:58                         ` Segher Boessenkool
2006-12-15  6:42                           ` Olof Johansson
2006-12-14  1:06             ` Olof Johansson
2006-12-14  0:34     ` Michael Ellerman [this message]
2006-12-13 10:40 ` [PATCH 7/9] MPIC MSI backend Michael Ellerman
2006-12-13 10:40 ` [PATCH 9/9] Enable MSI mappings for MPIC Michael Ellerman
2006-12-13 10:40 ` [PATCH 8/9] Activate MSI on Powerpc Michael Ellerman

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=1166056491.6838.13.camel@concordia.ozlabs.ibm.com \
    --to=michael@ellerman.id.au \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    /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).