[PATCH 6/7] MPIC MSI allocator
Michael Ellerman
michael at ellerman.id.au
Mon Apr 23 13:53:42 EST 2007
On Sun, 2007-04-22 at 22:50 -0500, Olof Johansson wrote:
> On Thu, Apr 19, 2007 at 05:35:28PM +1000, Michael Ellerman wrote:
> > To support MSI on MPIC we need a way to reserve and allocate hardware irq
> > numbers, this patch implements an allocator for that.
> >
> > New firmware platforms must define a "msi-available-ranges" property on their
> > MPIC node for MSI to work. For BROKEN_U3 we do a best-guess setup.
>
> It's time to rename BROKEN_U3. It used to be the config option to enable
> a few workarounds, but now it's used to select whenever there's a U3 in
> the system. Care to do it in the scope of this patch set?
Yeah it's pretty ugly. I guess I can do it. Got an idea for a better
name? MPIC_HT?
> > Index: msi-new/include/asm-powerpc/mpic.h
> > ===================================================================
> > --- msi-new.orig/include/asm-powerpc/mpic.h
> > +++ msi-new/include/asm-powerpc/mpic.h
> > @@ -292,6 +292,11 @@ struct mpic
> > u32 *hw_set;
> > #endif
> >
> > +#ifdef CONFIG_PCI_MSI
> > + spinlock_t bitmap_lock;
> > + unsigned long *hwirq_bitmap;
> > +#endif
>
> Besides the #ifdef there's nothing in the name that indicates that it's
> used for msi. Better names could be useful.
True. Although, it doesn't necessarily have anything to do with MSI,
it's just a bitmap of hwirqs that are used/free. As it happens we only
need it when we're doing MSI though.
>
> > @@ -440,5 +445,11 @@ void mpic_set_clk_ratio(struct mpic *mpi
> > /* Enable/Disable EPIC serial interrupt mode */
> > void mpic_set_serial_int(struct mpic *mpic, int enable);
> >
> > +#ifdef CONFIG_PCI_MSI
> > +extern int mpic_msi_init_allocator(struct mpic *mpic);
> > +extern irq_hw_number_t mpic_msi_alloc_hwirqs(struct mpic *mpic, int num);
> > +extern void mpic_msi_free_hwirqs(struct mpic *mpic, int offset, int num);
> > +#endif
>
> These should go in mpic.h instead.
Yep.
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/ddd1dc2b/attachment.pgp>
More information about the Linuxppc-dev
mailing list