From: Michael Ellerman <michael@ellerman.id.au>
To: Milton Miller <miltonm@bga.com>
Cc: linuxppc-dev@ozlabs.org, linux-pci <linux-pci@atrey.karlin.mff.cuni.cz>
Subject: Re: [PATCH 2/7] Powerpc MSI infrastructure
Date: Mon, 23 Apr 2007 14:28:26 +1000 [thread overview]
Message-ID: <1177302506.3889.38.camel@concordia.ozlabs.ibm.com> (raw)
In-Reply-To: <5978bcffcf3b9348ebd4349ba8c2730a@bga.com>
[-- Attachment #1: Type: text/plain, Size: 3192 bytes --]
On Sat, 2007-04-21 at 18:15 -0500, Milton Miller wrote:
> On Apr 19, 2007, Michael Ellerman wrote:
> > This patch provides the architecture specific hooks to support MSI on
> > powerpc. We implement the newly added arch_setup_msi_irqs() and
> > arch_teardown_msi_irqs(), and then delegate to ppc_md routines.
> >
>
> > Index: msi-new/arch/powerpc/kernel/msi.c
> > ===================================================================
> > --- /dev/null
> > +++ msi-new/arch/powerpc/kernel/msi.c
> > @@ -0,0 +1,38 @@
> > +/*
> > + * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License
> > + * as published by the Free Software Foundation; either version
> > + * 2 of the License, or (at your option) any later version.
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/msi.h>
> > +
> > +#include <asm/machdep.h>
> > +
> > +int arch_msi_check_device(struct pci_dev* dev, int nvec, int type)
> > +{
> > + if (ppc_md.msi_check_device) {
> > + pr_debug("msi: Using platform check routine.\n");
> > + return ppc_md.msi_check_device(dev, nvec, type);
> > + }
> > +
> > + if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) {
> > + pr_debug("msi: Platform doesn't provide MSI callbacks.\n");
> > + return -ENOSYS;
> > + }
>
> Should we not do this check first? Or do you expect some platform
> to fill out these hooks in the check call above? Othewise we will
> branch to function pointer NULL.
Not really. More a case of if you provide check then you'd better get
your act together and provide the others. I'll rearrange it to be safer.
>
> > +
> > + return 0;
> > +}
> > +
> > +int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> > +{
> > + return ppc_md.setup_msi_irqs(dev, nvec, type);
> > +}
> > +
> > +void arch_teardown_msi_irqs(struct pci_dev *dev)
> > +{
> > + return ppc_md.teardown_msi_irqs(dev);
> > +}
>
>
> > Index: msi-new/arch/powerpc/kernel/Makefile
> > ===================================================================
> > --- msi-new.orig/arch/powerpc/kernel/Makefile
> > +++ msi-new/arch/powerpc/kernel/Makefile
>
> > +obj-$(CONFIG_PCI_MSI) += msi.o
>
>
> Do we really need a new file for these simple hooks? It doesn't look
> like anthing else is going to be added to it either. I'd prefer to
> just do an ifdef in pci.c. Hmmm, we don't seem to have that, but
> these are soo small I'd include machdep.h and put them inline in
> asm-powerpc/pci.h.
I'd rather leave it as is. We can't have them inline, because they're
already defined in drivers/pci/msi.c. And having the CONFIG logic in the
Makefile is cleaner than #ifdef goo. Also it might grow one day, if we
make the hooks per pci_dev or per bus rather than in ppc_md.
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 --]
next prev parent reply other threads:[~2007-04-23 4:28 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-19 7:35 [PATCH 1/7] Rip out the existing powerpc msi stubs Michael Ellerman
2007-04-19 7:35 ` [PATCH 3/7] RTAS MSI implementation Michael Ellerman
2007-04-19 7:35 ` [PATCH 2/7] Powerpc MSI infrastructure Michael Ellerman
2007-04-21 23:15 ` Milton Miller
2007-04-23 4:28 ` Michael Ellerman [this message]
2007-04-19 7:35 ` [PATCH 4/7] Tell Phyp we support MSI Michael Ellerman
2007-04-19 7:35 ` [PATCH 5/7] Enable MSI mappings for MPIC Michael Ellerman
2007-04-21 23:16 ` Milton Miller
2007-04-22 0:06 ` Benjamin Herrenschmidt
2007-04-22 4:53 ` Milton Miller
2007-04-23 4:10 ` Michael Ellerman
2007-04-19 7:35 ` [PATCH 6/7] MPIC MSI allocator Michael Ellerman
2007-04-21 23:17 ` Milton Miller
2007-04-23 4:04 ` Michael Ellerman
2007-04-23 6:20 ` Milton Miller
2007-04-23 3:50 ` Olof Johansson
2007-04-23 3:53 ` Michael Ellerman
2007-04-24 1:29 ` Benjamin Herrenschmidt
2007-04-24 9:26 ` Segher Boessenkool
2007-04-24 9:39 ` Benjamin Herrenschmidt
2007-04-24 9:44 ` Segher Boessenkool
2007-04-24 9:51 ` Benjamin Herrenschmidt
2007-04-19 7:35 ` [PATCH 7/7] MPIC MSI backend Michael Ellerman
2007-04-20 8:40 ` Segher Boessenkool
2007-04-20 14:39 ` Michael Ellerman
2007-04-21 23:17 ` Milton Miller
2007-04-22 7:06 ` Segher Boessenkool
2007-04-22 19:30 ` Olof Johansson
2007-04-23 4:24 ` Michael Ellerman
2007-04-23 8:24 ` Segher Boessenkool
2007-04-23 8:31 ` Michael Ellerman
2007-04-23 17:33 ` Segher Boessenkool
2007-04-23 3:45 ` Michael Ellerman
-- strict thread matches above, loose matches on Subject: below --
2007-05-08 2:58 [PATCH 1/7] Rip out the existing powerpc msi stubs Michael Ellerman
2007-05-08 2:58 ` [PATCH 2/7] Powerpc MSI infrastructure 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=1177302506.3889.38.camel@concordia.ozlabs.ibm.com \
--to=michael@ellerman.id.au \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=linuxppc-dev@ozlabs.org \
--cc=miltonm@bga.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).