All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: BCM5301X: Add back handler ignoring external imprecise aborts
@ 2016-10-29 11:12 ` Rafał Miłecki
  0 siblings, 0 replies; 25+ messages in thread
From: Rafał Miłecki @ 2016-10-29 11:12 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Arnd Bergmann, Bjorn Helgaas, Lucas Stach, Hauke Mehrtens,
	Jon Mason, Mark Rutland, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA, Rafał Miłecki

From: Rafał Miłecki <rafal-g1n6cQUeyibVItvQsEIGlw@public.gmane.org>

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 <rafal-g1n6cQUeyibVItvQsEIGlw@public.gmane.org>
---
 arch/arm/mach-bcm/bcm_5301x.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c
index c8830a2..fe067f6 100644
--- a/arch/arm/mach-bcm/bcm_5301x.c
+++ b/arch/arm/mach-bcm/bcm_5301x.c
@@ -9,14 +9,42 @@
 #include <asm/hardware/cache-l2x0.h>
 
 #include <asm/mach/arch.h>
+#include <asm/siginfo.h>
+#include <asm/signal.h>
+
+#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
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-10-31 22:28 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-29 11:12 [PATCH] ARM: BCM5301X: Add back handler ignoring external imprecise aborts Rafał Miłecki
2016-10-29 11:12 ` Rafał Miłecki
2016-10-29 11:12 ` Rafał Miłecki
2016-10-31 18:08 ` Scott Branden
2016-10-31 18:08   ` Scott Branden
     [not found]   ` <a491509e-5cfc-fc7d-0011-dfcab3c884ea-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-10-31 20:59     ` Hauke Mehrtens
2016-10-31 20:59       ` Hauke Mehrtens
2016-10-31 20:59       ` Hauke Mehrtens
2016-10-31 21:01       ` Florian Fainelli
2016-10-31 21:01         ` Florian Fainelli
2016-10-31 21:46         ` Scott Branden
2016-10-31 21:46           ` Scott Branden
     [not found]           ` <dcb21fe4-672f-4545-5b47-d764f390e741-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-10-31 21:56             ` Florian Fainelli
2016-10-31 21:56               ` Florian Fainelli
2016-10-31 21:56               ` Florian Fainelli
     [not found]               ` <18db27c7-1055-ff3c-0b0b-eeeaf5f3f5e0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-31 22:04                 ` Rafał Miłecki
2016-10-31 22:04                   ` Rafał Miłecki
2016-10-31 22:04                   ` Rafał Miłecki
2016-10-31 22:05               ` Scott Branden
2016-10-31 22:05                 ` Scott Branden
     [not found]                 ` <3847db9f-a8e1-b7fe-c2fa-19ea893bae5f-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-10-31 22:16                   ` Rafał Miłecki
2016-10-31 22:16                     ` Rafał Miłecki
2016-10-31 22:16                     ` Rafał Miłecki
2016-10-31 22:28                     ` Ray Jui
2016-10-31 22:28                       ` Ray Jui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.