[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5216496.erm7FtUABJ@wuerfel>
Date: Tue, 18 Nov 2014 12:33:11 +0100
From: Arnd Bergmann <arnd@...db.de>
To: linux-arm-kernel@...ts.infradead.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Tony Luck <tony.luck@...el.com>,
Marc Zyngier <marc.zyngier@....com>, linux-pci@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Grant Likely <grant.likely@...aro.org>,
Yijing Wang <wangyijing@...wei.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Yingjoe Chen <yingjoe.chen@...iatek.com>,
Jiang Liu <jiang.liu@...ux.intel.com>,
Matthias Brugger <matthias.bgg@...il.com>
Subject: Re: [PATCH] asm-generic: Add msi.h
On Tuesday 18 November 2014 11:59:39 Thomas Gleixner wrote:
> On Tue, 18 Nov 2014, Arnd Bergmann wrote:
>
> > On Tuesday 18 November 2014 11:34:37 Thomas Gleixner wrote:
> > > To support MSI irq domains we want a generic data structure for
> > > allocation, but we need the option to provide an architecture specific
> > > version of it. So instead of playing #ifdef games in linux/msi.h we
> > > add a generic header file and let architectures decide whether to
> > > include it or to provide their own implementation and provide the
> > > required typedef.
> >
> > Acked-by: Arnd Bergmann <arnd@...db.de>
> >
> > for merging the asm-generic file
> >
> > > I know that typedefs are not really nice, but in this case there are no
> > > forward declarations required and it's the simplest solution.
> >
> > I must be missing the obvious: what problem does the typedef solve
> > that you would have with just a struct?
>
> It's not obvious. :)
>
> The irqdomain stuff is pretty device tree centric, but the new stacked
> irqdomains are to be used by x86 as well. So we made some of the
> interfaces opaque, i.e. void *allocation_arg.
>
> Now MSI is a bit differnet as it cannot be decribed by DT, so we want
> a proper generic data structure for it and of course we want to have a
> type for it.
>
> Now x86 has a bit more convoluted requirements where we prefer for
> simplicity reasons to reuse the allocation data structure which we
> have alredy for the non MSI cases, so it can be handed down to the
> opaque interfaces as well.
>
> So we have the generic:
>
> struct msi_alloc_info {
> ....
> };
>
> and
>
> struct x86_alloc_info {
> ...
> };
>
> So we either can do in x86:
>
> struct msi_alloc_info {
> struct x86_alloc_info info;
> };
>
> or use a typedef which maps x86_alloc_info to msi_alloc_info_t.
>
> I think the typedef is more sane in that case.
>
Ok, makes sense.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists