linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/8] irqchip: armada-370-xp: implement MSI support
Date: Tue, 18 Jun 2013 13:26:04 +0200	[thread overview]
Message-ID: <20130618112604.GD6322@mithrandir> (raw)
In-Reply-To: <20130618104338.584098e1@skate>

On Tue, Jun 18, 2013 at 10:43:38AM +0200, Thomas Petazzoni wrote:
> Dear Thierry Reding,
> 
> On Wed, 12 Jun 2013 12:42:40 +0200, Thierry Reding wrote:
> > On Thu, Jun 06, 2013 at 06:41:24PM +0200, Thomas Petazzoni wrote:
> > [...]
> > > @@ -292,6 +454,8 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
> > >  
> > >  #endif
> > >  
> > > +	armada_370_xp_msi_init(node);
> > > +
> > 
> > So I see that you don't have access to the original platform device
> > here, but you could use of_find_device_by_node() to obtain it and pass
> > that into armada_370_xp_msi_init() in order to set the msi_chip.dev
> > field. Or you could do the lookup in armada_370_xp_msi_init() if you
> > don't need it for anything else in armada_370_xp_mpic_of_init().
> 
> As I replied to Grant, of_find_device_by_node() returns NULL, I believe
> because the all IRQ controller driver initialization is done pretty
> early, before the of_platform_populate() call is made, so there is no
> platform_device associated with the IRQ controller node at the time the
> armada_370_xp_mpic_of_init() function is called.
> 
> Do you see another approach, especially in relation to your comment on
> PATCH 2/8 ?

Hmmm, that's too bad. The only other possibility that I see is that you
could associate the struct device at a later point when it becomes
available, but looking at the irqchip driver it doesn't look like you
get notification of that either. I suppose you could add a
platform_driver to it and hook things up in its .probe() callback, but
I'm not sure if that's in line with how the irqchip was designed. Adding
Grant Likely and Thomas Gleixner on Cc, maybe they have better advice.

Looking at other irqchip drivers I find it a bit odd to see how they're
structured, though. We've been preaching for years that drivers should
be well-encapsulated and told everybody it was bad to use globals and
they should be associating driver-specific data with each instance of a
device. Then comes along irqchip and all of a sudden it's okay to use
globals again. It feels a bit fragile.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130618/51731f1c/attachment.sig>

  reply	other threads:[~2013-06-18 11:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 16:41 [PATCH v2 0/8] MSI support for Marvell EBU PCIe driver Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 1/8] PCI: Introduce new MSI chip infrastructure Thomas Petazzoni
2013-06-18 22:46   ` Bjorn Helgaas
2013-06-19 11:42     ` Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 2/8] PCI: Add registry of MSI chips Thomas Petazzoni
2013-06-12 10:33   ` Thierry Reding
2013-06-18 22:48   ` Bjorn Helgaas
2013-06-19 11:42     ` Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 3/8] irqchip: armada-370-xp: properly request resources Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 4/8] irqchip: armada-370-xp: implement MSI support Thomas Petazzoni
2013-06-11 13:37   ` Grant Likely
2013-06-18  8:42     ` Thomas Petazzoni
2013-06-18 10:15       ` Grant Likely
2013-06-18 10:36         ` Thomas Petazzoni
2013-06-12 10:42   ` Thierry Reding
2013-06-18  8:43     ` Thomas Petazzoni
2013-06-18 11:26       ` Thierry Reding [this message]
2013-06-18 12:11         ` Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 5/8] arm: mvebu: the MPIC now provides MSI controller features Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 6/8] pci: mvebu: add support for MSI Thomas Petazzoni
2013-06-18 22:57   ` Bjorn Helgaas
2013-06-06 16:41 ` [PATCH v2 7/8] arm: mvebu: indicate that this platform supports MSI Thomas Petazzoni
2013-06-06 16:41 ` [PATCH v2 8/8] arm: mvebu: link PCIe controllers to the MSI controller Thomas Petazzoni
2013-06-06 17:17 ` [PATCH v2 0/8] MSI support for Marvell EBU PCIe driver Jason Cooper
2013-06-07  8:14   ` Thomas Petazzoni
2013-06-07 14:47     ` Jason Cooper
2013-06-06 18:51 ` Jason Cooper
2013-06-07  8:23   ` Thomas Petazzoni
2013-06-07 15:08     ` Jason Cooper
2013-06-07 17:00       ` Thomas Petazzoni
2013-06-18  8:56 ` Thomas Petazzoni

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=20130618112604.GD6322@mithrandir \
    --to=thierry.reding@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).