All of lore.kernel.org
 help / color / mirror / Atom feed
From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 05/12] arm: mm: retry on QSD icache parity errors
Date: Fri, 29 Jan 2010 07:50:06 +0100	[thread overview]
Message-ID: <20100129065006.GC1529@ucw.cz> (raw)
In-Reply-To: <1264719577-5436-6-git-send-email-dwalker@codeaurora.org>

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

  reply	other threads:[~2010-01-29  6:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100129065006.GC1529@ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.