[PATCH] drivers: pci: remove unused pci_sys_data structures

Arnd Bergmann arnd at arndb.de
Mon Nov 9 11:07:53 PST 2015

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 at arm.com>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: Will Deacon <will.deacon at arm.com>
> Cc: Bjorn Helgaas <bhelgaas at google.com>
> Cc: Rob Herring <robh at kernel.org>


Acked-by: Arnd Bergmann <arnd at 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?


More information about the linux-arm-kernel mailing list