]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm64: PCI: Manage controller-specific data on per-controller basis
authorTomasz Nowicki <tn@semihalf.com>
Thu, 24 Nov 2016 11:05:23 +0000 (12:05 +0100)
committerBjorn Helgaas <helgaas@kernel.org>
Tue, 6 Dec 2016 19:45:48 +0000 (13:45 -0600)
commit093d24a204425f71f4f106b7e62c8df4b456e1cc
tree09a6d3ace3e4d781d9d217bdb0085cfefbe1453b
parent08b1c19606b5fc7f895dae4d43d507b4da4a83bf
arm64: PCI: Manage controller-specific data on per-controller basis

Currently we use one shared global acpi_pci_root_ops structure to keep
controller-specific ops. We pass its pointer to acpi_pci_root_create() and
associate it with a host bridge instance for good.  Such a design implies
serious drawback. Any potential manipulation on the single system-wide
acpi_pci_root_ops leads to kernel crash. The structure content is not
really changing even across multiple host bridges creation; thus it was not
an issue so far.

In preparation for adding ECAM quirks mechanism (where controller-specific
PCI ops may be different for each host bridge) allocate new
acpi_pci_root_ops and fill in with data for each bridge. Now it is safe to
have different controller-specific info. As a consequence free
acpi_pci_root_ops when host bridge is released.

No functional changes in this patch.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
arch/arm64/kernel/pci.c