Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755363AbbHNOMM (ORCPT ); Fri, 14 Aug 2015 10:12:12 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:58103 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755192AbbHNOMK (ORCPT ); Fri, 14 Aug 2015 10:12:10 -0400 Message-ID: <1439561519.13210.55.camel@pengutronix.de> Subject: Re: [PATCH] ARM: keystone: add a work around to handle asynchronous external abort From: Lucas Stach To: Murali Karicheri Cc: ssantosh@kernel.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 14 Aug 2015 16:11:59 +0200 In-Reply-To: <55CDF579.4050408@ti.com> References: <1439320409-20084-1-git-send-email-m-karicheri2@ti.com> <55CDF579.4050408@ti.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:fa0f:41ff:fe58:4010 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3007 Lines: 84 Am Freitag, den 14.08.2015, 10:04 -0400 schrieb Murali Karicheri: > On 08/11/2015 03:13 PM, Murali Karicheri wrote: > > Currently on some devices, an asynchronous external abort exception > > happens during boot up when exception handlers are enabled in kernel > > before switching to user space. This patch adds a workaround to handle > > this once during boot. Many customers are already using this > > with out any issues and is required to workaround the above issue. > > > > Signed-off-by: Murali Karicheri > > --- > > arch/arm/mach-keystone/keystone.c | 26 ++++++++++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c > > index e2880105..c1d0fe5 100644 > > --- a/arch/arm/mach-keystone/keystone.c > > +++ b/arch/arm/mach-keystone/keystone.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -52,6 +53,24 @@ static struct notifier_block platform_nb = { > > .notifier_call = keystone_platform_notifier, > > }; > > > > +static bool ignore_first = true; > > +static int keystone_async_ext_abort_fault(unsigned long addr, unsigned int fsr, > > + struct pt_regs *regs) > > +{ > > + /* > > + * if first time, ignore this as this is a asynchronous external abort > > + * happening only some devices that couldn't be root caused and we add > > + * this work around to handle this first time. > > + */ > > + if (ignore_first) { > > + ignore_first = false; > > + return 0; > > + } > > + > > + /* Subsequent ones should be handled as fault */ > > + return 1; > > +} > > + > > static void __init keystone_init(void) > > { > > if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START) { > > @@ -61,6 +80,13 @@ static void __init keystone_init(void) > > } > > keystone_pm_runtime_init(); > > of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); > > + > > + /* > > + * Add a one time exception handler to catch asynchronous external > > + * abort > > + */ > > + hook_fault_code(17, keystone_async_ext_abort_fault, SIGBUS, 0, > > + "async external abort handler"); > > } > > > > static phys_addr_t keystone_virt_to_idmap(unsigned long x) > > > Can this be applied if it looks good? > The keystone PCIe host driver already hooks the same fault code. Those hooks are no chain, but a simple pointer, so one of those handlers is going to loose out. This likely isn't what you intended. Regards, Lucas -- Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/