[PATCH 7/7] MPIC MSI backend
Michael Ellerman
michael at ellerman.id.au
Mon Apr 23 13:45:22 EST 2007
On Sat, 2007-04-21 at 18:17 -0500, Milton Miller wrote:
> On Apr 19, 2007, Michael Ellerman wrote:
> > MPIC MSI backend. Based on code from Segher, heavily hacked by me.
> > Renamed to mpic_htmsi, as it only deals with MSI over Hypertransport.
> ...
> > Index: msi-new/arch/powerpc/sysdev/Makefile
> > ===================================================================
> > --- msi-new.orig/arch/powerpc/sysdev/Makefile
> > +++ msi-new/arch/powerpc/sysdev/Makefile
> > @@ -4,6 +4,7 @@ endif
> >
> > mpic-obj-y := mpic.o
> > mpic-obj-$(CONFIG_PCI_MSI) += mpic_msi.o
> > +mpic-obj-$(CONFIG_PCI_MSI) += mpic_htmsi.o
> > obj-$(CONFIG_MPIC) += $(mpic-obj-y)
>
> This is overly complicated. You aren't going to be making this
> a seperate link object anyways. It should end up somehting like
>
> mpic-msi-$(CONFIG_PCI_MSI) := mpic_msi.o mpic_htmsi.o
> obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-y)
Fixed.
> > -static void mpic_unmask_irq(unsigned int irq)
> > +void mpic_unmask_irq(unsigned int irq)
> ...
> > -static void mpic_mask_irq(unsigned int irq)
> > +void mpic_mask_irq(unsigned int irq)
> ...
> Ok mpic.c is big enough already.
Yeah I tried it the other way, but it was messy.
> > Index: msi-new/arch/powerpc/sysdev/mpic.h
> > ===================================================================
> > --- msi-new.orig/arch/powerpc/sysdev/mpic.h
> > +++ msi-new/arch/powerpc/sysdev/mpic.h
> > @@ -11,14 +11,23 @@
> > *
> > */
> >
> > +#include <linux/irq.h>
> > +
>
> Why do you need this now? You already had uses of irq_ht_umber_t
> and struct mpic. Unless this should be in the earlier patch?
Cruft, removed.
> > #ifdef CONFIG_PCI_MSI
> > extern void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t
> > hwirq);
> > +extern int mpic_htmsi_init(struct mpic *mpic);
> > #else
> > static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
> > irq_hw_number_t hwirq)
> > {
> > return;
> > }
> > +static inline int mpic_htmsi_init(struct mpic *mpic) { return -1; }
>
> more lines please
OK.
> > +int mpic_htmsi_init(struct mpic *mpic)
> > +{
> > + int rc;
> > +
> > + rc = mpic_msi_init_allocator(mpic);
> > + if (rc) {
> > + pr_debug("htmsi: Error allocating bitmap!\n");
> > + return rc;
> > + }
> > +
> > + pr_debug("htmsi: Registering MPIC MSI callbacks.\n");
> > +
> > + BUG_ON(msi_mpic);
> > + msi_mpic = mpic;
> > +
> > + ppc_md.setup_msi_irqs = htmsi_setup_msi_irqs;
> > + ppc_md.teardown_msi_irqs = htmsi_teardown_msi_irqs;
> > + ppc_md.msi_check_device = htmsi_msi_check_device;
>
> Unlike the rtas patch, this one didn't advertise it was
> going to set the arch hooks unconditionally.
Yeah OK, fixed.
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070423/2e40fcb4/attachment.pgp>
More information about the Linuxppc-dev
mailing list