public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] asm-generic: Add msi.h
Date: Tue, 18 Nov 2014 12:33:11 +0100	[thread overview]
Message-ID: <5216496.erm7FtUABJ@wuerfel> (raw)
In-Reply-To: <alpine.DEB.2.11.1411181149350.3909@nanos>

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@arndb.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

      reply	other threads:[~2014-11-18 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18 10:34 [PATCH] asm-generic: Add msi.h Thomas Gleixner
2014-11-18 10:39 ` Arnd Bergmann
2014-11-18 10:59   ` Thomas Gleixner
2014-11-18 11:33     ` Arnd Bergmann [this message]

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=5216496.erm7FtUABJ@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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