* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
@ 2010-01-28 22:59 Daniel Walker
2010-01-29 6:50 ` Pavel Machek
2010-01-29 11:11 ` Catalin Marinas
0 siblings, 2 replies; 7+ messages in thread
From: Daniel Walker @ 2010-01-28 22:59 UTC (permalink / raw)
To: linux-arm-kernel
From: Steve Muckle <smuckle@quicinc.com>
Parity errors in the icache on QSD can be worked around either by
retrying the access, or invalidating the icache. The whole icache
must be invalidated since the data abort is imprecise (the faulting
address is not known).
Signed-off-by: Steve Muckle <smuckle@quicinc.com>
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
---
arch/arm/mm/fault.c | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 10e0680..bea3e75 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -2,6 +2,7 @@
* linux/arch/arm/mm/fault.c
*
* Copyright (C) 1995 Linus Torvalds
+ * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
* Modifications for ARM processor (c) 1995-2004 Russell King
*
* This program is free software; you can redistribute it and/or modify
@@ -442,6 +443,39 @@ do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
return 1;
}
+static int
+do_imprecise_ext(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
+{
+#ifdef CONFIG_ARCH_MSM_SCORPION
+ unsigned int regval;
+ static unsigned char flush_toggle;
+
+ asm("mrc p15, 0, %0, c5, c1, 0\n" /* read adfsr for fault status */
+ : "=r" (regval));
+ if (regval == 0x2) {
+ /* Fault was caused by icache parity error. Alternate
+ * simply retrying the access and flushing the icache. */
+ flush_toggle ^= 1;
+ if (flush_toggle)
+ asm("mcr p15, 0, %0, c7, c5, 0\n"
+ :
+ : "r" (regval)); /* input value is ignored */
+ /* Clear fault in EFSR. */
+ asm("mcr p15, 7, %0, c15, c0, 1\n"
+ :
+ : "r" (regval));
+ /* Clear fault in ADFSR. */
+ regval = 0;
+ asm("mcr p15, 0, %0, c5, c1, 0\n"
+ :
+ : "r" (regval));
+ return 0;
+ }
+#endif
+
+ return 1;
+}
+
static struct fsr_info {
int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
int sig;
@@ -479,7 +513,7 @@ static struct fsr_info {
{ do_bad, SIGBUS, 0, "unknown 19" },
{ do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
{ do_bad, SIGBUS, 0, "unknown 21" },
- { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
+ { do_imprecise_ext, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
{ do_bad, SIGBUS, 0, "unknown 23" },
{ do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */
{ do_bad, SIGBUS, 0, "unknown 25" },
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
2010-01-28 22:59 [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors Daniel Walker
@ 2010-01-29 6:50 ` Pavel Machek
2010-01-29 11:11 ` Catalin Marinas
1 sibling, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2010-01-29 6:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi!
> Parity errors in the icache on QSD can be worked around either by
> retrying the access, or invalidating the icache. The whole icache
> must be invalidated since the data abort is imprecise (the faulting
> address is not known).
>
> Signed-off-by: Steve Muckle <smuckle@quicinc.com>
> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
> @@ -442,6 +443,39 @@ do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
> return 1;
> }
>
> +static int
> +do_imprecise_ext(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
> +{
> +#ifdef CONFIG_ARCH_MSM_SCORPION
> + unsigned int regval;
> + static unsigned char flush_toggle;
> +
> + asm("mrc p15, 0, %0, c5, c1, 0\n" /* read adfsr for fault status */
> + : "=r" (regval));
> + if (regval == 0x2) {
> + /* Fault was caused by icache parity error. Alternate
> + * simply retrying the access and flushing the icache. */
> + flush_toggle ^= 1;
> + if (flush_toggle)
> + asm("mcr p15, 0, %0, c7, c5, 0\n"
> + :
> + : "r" (regval)); /* input value is ignored */
> + /* Clear fault in EFSR. */
> + asm("mcr p15, 7, %0, c15, c0, 1\n"
> + :
> + : "r" (regval));
> + /* Clear fault in ADFSR. */
> + regval = 0;
> + asm("mcr p15, 0, %0, c5, c1, 0\n"
> + :
> + : "r" (regval));
> + return 0;
> + }
> +#endif
Tell the user or at least keep the count, so cache going bad can be
recognized?
Also you probably need asm volatile, and probably do not need those
\n-s.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
2010-01-28 22:59 [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors Daniel Walker
2010-01-29 6:50 ` Pavel Machek
@ 2010-01-29 11:11 ` Catalin Marinas
2010-02-23 18:36 ` Daniel Walker
1 sibling, 1 reply; 7+ messages in thread
From: Catalin Marinas @ 2010-01-29 11:11 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2010-01-28 at 22:59 +0000, Daniel Walker wrote:
> diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
> index 10e0680..bea3e75 100644
> --- a/arch/arm/mm/fault.c
> +++ b/arch/arm/mm/fault.c
[...]
> static struct fsr_info {
> int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
> int sig;
> @@ -479,7 +513,7 @@ static struct fsr_info {
> { do_bad, SIGBUS, 0, "unknown 19" },
> { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
> { do_bad, SIGBUS, 0, "unknown 21" },
> - { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
> + { do_imprecise_ext, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
Can you not use hook_fault_code() and move the do_imprecise_ext() to a
platform-specific file (under arch/arm/mach-* maybe)?
--
Catalin
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
2010-01-29 11:11 ` Catalin Marinas
@ 2010-02-23 18:36 ` Daniel Walker
2010-02-23 19:02 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Walker @ 2010-02-23 18:36 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 2010-01-29 at 11:11 +0000, Catalin Marinas wrote:
> On Thu, 2010-01-28 at 22:59 +0000, Daniel Walker wrote:
> > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
> > index 10e0680..bea3e75 100644
> > --- a/arch/arm/mm/fault.c
> > +++ b/arch/arm/mm/fault.c
> [...]
> > static struct fsr_info {
> > int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
> > int sig;
> > @@ -479,7 +513,7 @@ static struct fsr_info {
> > { do_bad, SIGBUS, 0, "unknown 19" },
> > { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
> > { do_bad, SIGBUS, 0, "unknown 21" },
> > - { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
> > + { do_imprecise_ext, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
>
> Can you not use hook_fault_code() and move the do_imprecise_ext() to a
> platform-specific file (under arch/arm/mach-* maybe)?
>
How do you mean? I'm not sure how we would move this into
arch/arm/mach- ..
Daniel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
2010-02-23 18:36 ` Daniel Walker
@ 2010-02-23 19:02 ` Russell King - ARM Linux
2010-02-23 19:06 ` Daniel Walker
0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2010-02-23 19:02 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 23, 2010 at 10:36:08AM -0800, Daniel Walker wrote:
> On Fri, 2010-01-29 at 11:11 +0000, Catalin Marinas wrote:
> > On Thu, 2010-01-28 at 22:59 +0000, Daniel Walker wrote:
> > > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
> > > index 10e0680..bea3e75 100644
> > > --- a/arch/arm/mm/fault.c
> > > +++ b/arch/arm/mm/fault.c
> > [...]
> > > static struct fsr_info {
> > > int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
> > > int sig;
> > > @@ -479,7 +513,7 @@ static struct fsr_info {
> > > { do_bad, SIGBUS, 0, "unknown 19" },
> > > { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
> > > { do_bad, SIGBUS, 0, "unknown 21" },
> > > - { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
> > > + { do_imprecise_ext, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
> >
> > Can you not use hook_fault_code() and move the do_imprecise_ext() to a
> > platform-specific file (under arch/arm/mach-* maybe)?
> >
>
> How do you mean? I'm not sure how we would move this into
> arch/arm/mach- ..
Err, exactly as Catalin says. Use hook_fault_code() to hook into the
fault table at run time, just like platforms which have to handle
imprecise exceptions on PCI and the alignment fault handler do.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
2010-02-23 19:02 ` Russell King - ARM Linux
@ 2010-02-23 19:06 ` Daniel Walker
2010-02-23 19:09 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Walker @ 2010-02-23 19:06 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 2010-02-23 at 19:02 +0000, Russell King - ARM Linux wrote:
> > > Can you not use hook_fault_code() and move the do_imprecise_ext() to a
> > > platform-specific file (under arch/arm/mach-* maybe)?
> > >
> >
> > How do you mean? I'm not sure how we would move this into
> > arch/arm/mach- ..
>
> Err, exactly as Catalin says. Use hook_fault_code() to hook into the
> fault table at run time, just like platforms which have to handle
> imprecise exceptions on PCI and the alignment fault handler do.
"Can you not use hook_fault_code()"
Typo maybe ?
Daniel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
2010-02-23 19:06 ` Daniel Walker
@ 2010-02-23 19:09 ` Russell King - ARM Linux
0 siblings, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2010-02-23 19:09 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 23, 2010 at 11:06:58AM -0800, Daniel Walker wrote:
> On Tue, 2010-02-23 at 19:02 +0000, Russell King - ARM Linux wrote:
>
> > > > Can you not use hook_fault_code() and move the do_imprecise_ext() to a
> > > > platform-specific file (under arch/arm/mach-* maybe)?
> > > >
> > >
> > > How do you mean? I'm not sure how we would move this into
> > > arch/arm/mach- ..
> >
> > Err, exactly as Catalin says. Use hook_fault_code() to hook into the
> > fault table at run time, just like platforms which have to handle
> > imprecise exceptions on PCI and the alignment fault handler do.
>
>
> "Can you not use hook_fault_code()"
>
> Typo maybe ?
I don't think so. It's a request for you to use hook_fault_code().
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-02-23 19:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 22:59 [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors Daniel Walker
2010-01-29 6:50 ` Pavel Machek
2010-01-29 11:11 ` Catalin Marinas
2010-02-23 18:36 ` Daniel Walker
2010-02-23 19:02 ` Russell King - ARM Linux
2010-02-23 19:06 ` Daniel Walker
2010-02-23 19:09 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).