]> git.ipfire.org Git - people/arne_f/kernel.git/commit
arm64: PCI: Manage controller-specific data on per-controller basis
authorTomasz Nowicki <tn@semihalf.com>
Tue, 4 Apr 2017 19:32:08 +0000 (19:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:41:17 +0000 (12:41 +0200)
commitcc49b39f3f2d82c217a5f1f9c1ae795ec53fe786
tree9766db7347e31d85d2aa4a4622de4342cdcf2b5d
parent625fd9d1af7070ff3a54c0c6e93a7c654425a1d7
arm64: PCI: Manage controller-specific data on per-controller basis

[ Upstream commit 093d24a204425f71f4f106b7e62c8df4b456e1cc ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/pci.c