diff mbox

[v3,3/4] ARM64/PCI: remove arch specific pcibios_enable_device()

Message ID 1465383890-13538-4-git-send-email-lorenzo.pieralisi@arm.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Lorenzo Pieralisi June 8, 2016, 11:04 a.m. UTC
The arm64 pcibios_enable_device() implementation exists solely
to prevent enabling PCI resources on PCI_PROBE_ONLY systems, since
on those systems the PCI resources are currently not claimed (ie
inserted in the PCI resource tree - which means their parent
pointer is not correctly set-up) therefore they can not be enabled
since this would trigger PCI set-ups failures.

By introducing resources claiming in the PCI host controllers set-ups
that have PCI_PROBE_ONLY as a probe option, there is no need for arch
specific pcibios_enable_device() implementations anymore in that the
kernel can rely on the generic pcibios_enable_device() implementation
without resorting to arch specific code to work around the missing
resources claiming enumeration step.

On !PCI_PROBE_ONLY PCI bus set-ups, resources are always assigned
in the PCI host controllers drivers; since the PCI resource assignment
API takes care of inserting the assigned resources in the resource tree,
the resources parent pointer is correctly set-up, which means that this
patch leaves behaviour unchanged for all arm64 PCI set-ups that do not
set the PCI_PROBE_ONLY flag.

Remove the pcibios_enable_device() function from the arm64 arch
back-end so that the kernel now uses its generic implementation.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/pci.c | 13 -------------
 1 file changed, 13 deletions(-)
diff mbox

Patch

diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 3c4e308..39cfa03 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -36,19 +36,6 @@  resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 	return res->start;
 }
 
-/**
- * pcibios_enable_device - Enable I/O and memory.
- * @dev: PCI device to be enabled
- * @mask: bitmask of BARs to enable
- */
-int pcibios_enable_device(struct pci_dev *dev, int mask)
-{
-	if (pci_has_flag(PCI_PROBE_ONLY))
-		return 0;
-
-	return pci_enable_resources(dev, mask);
-}
-
 /*
  * Try to assign the IRQ number from DT when adding a new device
  */