linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drivers: pci: remove unused pci_sys_data structures
Date: Mon, 09 Nov 2015 20:07:53 +0100	[thread overview]
Message-ID: <7247058.o5kTvZ3CSC@wuerfel> (raw)
In-Reply-To: <1447095459-21777-1-git-send-email-lorenzo.pieralisi@arm.com>

On Monday 09 November 2015 18:57:39 Lorenzo Pieralisi wrote:
> Commit b3a72384fe29 ("ARM/PCI: Replace pci_sys_data->align_resource
> with global function pointer") removed the struct pci_sys_data
> dependency from the ARM pcibios functions that are part of the
> common ARM PCI arch back-end (eg pcibios_align_resource()), so that
> struct pci_sys_data has now become data that is only used internally
> by the ARM bios32 layer (ie pci_common_init_dev()) and by host
> controllers drivers callbacks (eg pci_sys_data.setup) that rely on the
> ARM bios32 API to probe.
> 
> PCI host controller drivers that do not rely on ARM bios32 calls to
> probe do not need to have the pci_bus.sysdata pointer field pointing
> at a struct pci_sys_data anymore, therefore it can be removed from the
> respective drivers data structures.
> 
> This patch removes the pci_sys_data structures from the host
> controller drivers that do not rely on ARM bios32 interface to
> scan the PCI bus, completing the pci_sys_data clean-up and removing
> the related dependency on arch/arm specific data.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Rob Herring <robh@kernel.org>
> 

Nice!

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.

Any idea why it was done with a global function pointer for
ARM rather than a proper solution?

	Arnd

  reply	other threads:[~2015-11-09 19:07 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 [this message]
2015-11-10  6:19   ` Gabriele Paoloni
2015-11-10  9:39     ` Arnd Bergmann
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=7247058.o5kTvZ3CSC@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).