1 From bd5d4593c79cfd56af12d91c911bd3a6abae2e44 Mon Sep 17 00:00:00 2001
2 From: Kishon Vijay Abraham I <kishon@ti.com>
3 Date: Mon, 25 Mar 2019 15:09:33 +0530
4 Subject: PCI: keystone: Prevent ARM32 specific code to be compiled for ARM64
6 [ Upstream commit f316a2b53cd7f37963ae20ec7072eb27a349a4ce ]
8 hook_fault_code() is an ARM32 specific API for hooking into data abort.
10 AM65X platforms (that integrate ARM v8 cores and select CONFIG_ARM64 as
11 arch) rely on pci-keystone.c but on them the enumeration of a
12 non-present BDF does not trigger a bus error, so the fixup exception
13 provided by calling hook_fault_code() is not needed and can be guarded
16 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
17 [lorenzo.pieralisi@arm.com: commit log]
18 Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 drivers/pci/controller/dwc/pci-keystone.c | 4 ++++
22 1 file changed, 4 insertions(+)
24 diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
25 index e88bd221fffe..5e199e7d2d4f 100644
26 --- a/drivers/pci/controller/dwc/pci-keystone.c
27 +++ b/drivers/pci/controller/dwc/pci-keystone.c
28 @@ -237,6 +237,7 @@ static void ks_pcie_setup_interrupts(struct keystone_pcie *ks_pcie)
29 ks_dw_pcie_enable_error_irq(ks_pcie);
34 * When a PCI device does not exist during config cycles, keystone host gets a
35 * bus error instead of returning 0xffffffff. This handler always returns 0
36 @@ -256,6 +257,7 @@ static int keystone_pcie_fault(unsigned long addr, unsigned int fsr,
42 static int __init ks_pcie_host_init(struct pcie_port *pp)
44 @@ -279,12 +281,14 @@ static int __init ks_pcie_host_init(struct pcie_port *pp)
46 writel(val, pci->dbi_base + PCIE_CAP_BASE + PCI_EXP_DEVCTL);
50 * PCIe access errors that result into OCP errors are caught by ARM as
53 hook_fault_code(17, keystone_pcie_fault, SIGBUS, 0,
54 "Asynchronous external abort");