From: andrew.murray@arm.com (Andrew Murray)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: pci: pass a parent to pci_common_init()
Date: Fri, 12 Apr 2013 13:05:38 +0100 [thread overview]
Message-ID: <20130412120538.GA32488@arm.com> (raw)
In-Reply-To: <201304121326.56030.arnd@arndb.de>
On Fri, Apr 12, 2013 at 12:26:55PM +0100, Arnd Bergmann wrote:
> On Friday 12 April 2013, Linus Walleij wrote:
> > When working with device tree support for PCI on ARM you run
> > into a problem when mapping IRQs from the device tree irqmaps:
> > doing this the code in drivers/of/of_pci_irq.c will try to
> > find the OF node on the root bridge and this fails, because
> > bus->dev.of_node is NULL, and that in turn boils down to
> > the fact that pci_set_bus_of_node() has called
> > pcibios_get_phb_of_node() from drivers/pci/of.c to obtain
> > the OF node of the bridge or its parent and none is set
> > and thus NULL is returned.
> >
> > Fix this by adding an additional parent argument when
> > registering PCI bridges on the ARM architecture using the
> > pci_common_init() call, and pass along this parent to
> > pci_scan_root_bus() called from pcibios_init_hw() in
> > bios32.c and voila: the IRQ mappings start working:
> > the OF node can be retrieved from the parent.
> >
> > Currently all users are set to use NULL as argument to this
> > call, but subsequent patches to the Integrator/AP make use
> > of this facility to pass a parent.
>
> Could you try making it a less invasive patch by renaming
> pci_common_init to something else and providing a wrapper
> like this?
>
> static inline void pci_common_init(struct hw_pci *hw)
> {
> pci_common_init_dev(NULL, hw);
> }
>
> That would avoid most of the churn and get the same result.
>
> Arnd
>
I would also be happy with this. Though alternatively could you
not just add a struct device to hw_pci? Then change pcibios_init_hw
to use hw->device instead of NULL?
Andrew Murray
next prev parent reply other threads:[~2013-04-12 12:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1365719096-11639-1-git-send-email-linus.walleij@linaro.org>
2013-04-12 11:26 ` [PATCH] ARM: pci: pass a parent to pci_common_init() Arnd Bergmann
2013-04-12 12:05 ` Andrew Murray [this message]
2013-04-12 13:01 ` Arnd Bergmann
2013-04-12 13:48 ` Andrew Murray
2013-04-19 13:19 ` Russell King - ARM Linux
2013-04-19 13:06 ` Russell King - ARM Linux
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=20130412120538.GA32488@arm.com \
--to=andrew.murray@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.