From: Greg Kroah-Hartman Date: Wed, 5 Apr 2017 10:13:57 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.9.21~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7310f431c1acc4a4e63934293dadab078add610e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: arm-bcm5301x-add-back-handler-ignoring-external-imprecise-aborts.patch --- diff --git a/queue-4.9/arm-bcm5301x-add-back-handler-ignoring-external-imprecise-aborts.patch b/queue-4.9/arm-bcm5301x-add-back-handler-ignoring-external-imprecise-aborts.patch new file mode 100644 index 00000000000..8a51b8a182a --- /dev/null +++ b/queue-4.9/arm-bcm5301x-add-back-handler-ignoring-external-imprecise-aborts.patch @@ -0,0 +1,81 @@ +From 09f3510fb70a46c8921f2cf4a90dbcae460a6820 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 29 Oct 2016 13:12:29 +0200 +Subject: ARM: BCM5301X: Add back handler ignoring external imprecise aborts +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +commit 09f3510fb70a46c8921f2cf4a90dbcae460a6820 upstream. + +Since early BCM5301X days we got abort handler that was removed by +commit 937b12306ea79 ("ARM: BCM5301X: remove workaround imprecise abort +fault handler"). It assumed we need to deal only with pending aborts +left by the bootloader. Unfortunately this isn't true for BCM5301X. + +When probing PCI config space (device enumeration) it is expected to +have master aborts on the PCI bus. Most bridges don't forward (or they +allow disabling it) these errors onto the AXI/AMBA bus but not the +Northstar (BCM5301X) one. + +iProc PCIe controller on Northstar seems to be some older one, without +a control register for errors forwarding. It means we need to workaround +this at platform level. All newer platforms are not affected by this +issue. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-bcm/bcm_5301x.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +--- a/arch/arm/mach-bcm/bcm_5301x.c ++++ b/arch/arm/mach-bcm/bcm_5301x.c +@@ -9,14 +9,42 @@ + #include + + #include ++#include ++#include ++ ++#define FSR_EXTERNAL (1 << 12) ++#define FSR_READ (0 << 10) ++#define FSR_IMPRECISE 0x0406 + + static const char *const bcm5301x_dt_compat[] __initconst = { + "brcm,bcm4708", + NULL, + }; + ++static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr, ++ struct pt_regs *regs) ++{ ++ /* ++ * We want to ignore aborts forwarded from the PCIe bus that are ++ * expected and shouldn't really be passed by the PCIe controller. ++ * The biggest disadvantage is the same FSR code may be reported when ++ * reading non-existing APB register and we shouldn't ignore that. ++ */ ++ if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE)) ++ return 0; ++ ++ return 1; ++} ++ ++static void __init bcm5301x_init_early(void) ++{ ++ hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR, ++ "imprecise external abort"); ++} ++ + DT_MACHINE_START(BCM5301X, "BCM5301X") + .l2c_aux_val = 0, + .l2c_aux_mask = ~0, + .dt_compat = bcm5301x_dt_compat, ++ .init_early = bcm5301x_init_early, + MACHINE_END diff --git a/queue-4.9/series b/queue-4.9/series index f29b64ce21b..d14f4c45090 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -60,3 +60,4 @@ x86-mce-fix-copy-paste-error-in-exception-table-entries.patch lib-syscall-clear-return-values-when-no-stack.patch mm-rmap-fix-huge-file-mmap-accounting-in-the-memcg-stats.patch mm-hugetlb-use-pte_present-instead-of-pmd_present-in-follow_huge_pmd.patch +arm-bcm5301x-add-back-handler-ignoring-external-imprecise-aborts.patch