From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drivers: pci: remove unused pci_sys_data structures
Date: Tue, 10 Nov 2015 10:39:43 +0100 [thread overview]
Message-ID: <3909067.XQHO4zq4LS@wuerfel> (raw)
In-Reply-To: <EE11001F9E5DDD47B7634E2F8A612F2E162A5EC2@lhreml503-mbs>
On Tuesday 10 November 2015 06:19:17 Gabriele Paoloni wrote:
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > On the downside, I just saw how b3a72384fe29 ("ARM/PCI: Replace
> > pci_sys_data->align_resource with global function pointer") manages
> > to get rid of the last user of this, and how this is not the way
> > we had planned for it to be done.
> >
> > It doesn't matter that much, because there is only a single
> > user of hw->align_resource, but this is now unportable code and
> > cannot easily be separated from hw_pci. It also breaks if we ever
> > get a machine with two different host controllers on ARM that
> > don't use the same pointer here.
> >
> > I really would have hoped we could put that function pointer
> > into 'struct pci_host_bridge' instead, and eventually killed
> > off the architecture specific pcibios_align_resource function
> > as well.
>
> say we move that in pci_host_bridge struct,
>
> Are you suggesting to modify pcibios_init_hw to assign the
> align_resource function pointer at the end after
> pci_scan_root_bus_msi() has created the host bridge structure;
> then we can retrieve it in pcibios_align_resource using
> pci_find_host_bridge(dev->bus)....?
What I had in mind was more along the lines of removing the
any mention of the align_resource callback from the ARM bios32.c
code and to have the pci-mvebu driver set the pointer manually
at an appropriate point (I did not look what would be that
point). What you suggest above would work too, just doesn't go
as far.
In the long run, I think it would be good to migrate all drivers
in drivers/pci/host/ away from calling pcibios_init_hw() at
all, and just use architecture-independent interfaces and leave
the hw_pci/pci_sys_data based implementation for the traditional
PCI host implementations that we have in arch/arm/mach-* for
platforms that do not use devicetree. This is not something I'm
asking you to do at this point, though any help here is appreciated.
> > Any idea why it was done with a global function pointer for
> > ARM rather than a proper solution?
>
> Well just because I didn't think about the solution above...
>
> If you think the above one can work I can send out another
> patch to fix this...
That would be great, yes. As I said, it's currently harmless
but it would be better to get it right.
Arnd
next prev parent reply other threads:[~2015-11-10 9:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 18:57 [PATCH] drivers: pci: remove unused pci_sys_data structures Lorenzo Pieralisi
2015-11-09 19:07 ` Arnd Bergmann
2015-11-10 6:19 ` Gabriele Paoloni
2015-11-10 9:39 ` Arnd Bergmann [this message]
2015-11-25 18:12 ` Bjorn Helgaas
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=3909067.XQHO4zq4LS@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;
as well as URLs for NNTP newsgroup(s).