<p> Hi,</p>
<p>I have question the work-around code.<br>
The below code will be enter after handling exception handling path. (that is fix-up code)<br>
As far as i know, the dsb instruction should be inserted before the any isb instruction on exception handling code for breaking erratum condition .<br>
It could meet the requirement?</p>
<p>> source "arch/arm/common/Kconfig"<br>
> diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S<br>
> index 39e3fb3..3b17227 100644<br>
> --- a/arch/arm/mm/cache-v7.S<br>
> +++ b/arch/arm/mm/cache-v7.S<br>
> @@ -211,6 +211,9 @@ ENTRY(v7_coherent_user_range)<br>
>   * isn't mapped, fail with -EFAULT.<br>
>   */<br>
> 9001:<br>
> +#ifdef CONFIG_ARM_ERRATA_775420<br>
> + dsb<br>
> +#endif<br>
>   mov r0, #-EFAULT<br>
>   mov pc, lr<br>
>   UNWIND(.fnend )<br>
><br>
><br>
thanks</p>
<p>> On Thu, Sep 20, 2012 at 10:58:53AM +0100, Catalin Marinas wrote:<br>
> > On 12 September 2012 08:14, Simon Horman wrote:<br>
> > > +config ARM_ERRATA_775420<br>
> > > +       bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"<br>
> > > +       depends on CPU_V7<br>
> > > +       help<br>
> > > +         This option enables the workaround for the 775420 Cortex-A9 (r2p2,<br>
> > > +         r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance<br>
> > > +         operation aborts with MMU exception, it might cause the processor<br>
> > > +         deadlock. This workaround puts DSB before executing ISB at the<br>
> > > +         beginning of the abort exception handler.<br>
> > > +<br>
> > >  endmenu<br>
> ><br>
> > The only case where we can get an abort on cache maintenance is<br>
> > v7_coherent_user_range(). I don't think we have any ISB on the<br>
> > exception handling path for this function, so we could just add the<br>
> > DSB there:<br>
><br>
> I think that an advantage of Abe-san's implementation is that<br>
> it might to be a bit more robust. But your proposal is certainly<br>
> much cleaner and for that reason I agree it is a good option.<br>
><br>
> I've updated the patch, but since the code is now all yours<br>
> I'm unsure if the author should be changed or not.<br>
><br>
> ----------------------------------------------------------------<br>
> From: Kouei Abe <br>
><br>
> arm: Add ARM ERRATA 775420 workaround<br>
><br>
> Workaround for the 775420 Cortex-A9 (r2p2, r2p6,r2p8,r2p10,r3p0) erratum.<br>
> In case a date cache maintenance operation aborts with MMU exception, it<br>
> might cause the processor to deadlock. This workaround puts DSB before<br>
> executing ISB if an abort may occur on cache maintenance.<br>
><br>
> Based on work by Kouei Abe and feedback from Catalin Marinas.<br>
><br>
> Cc: Catalin Marinas <br>
> Signed-off-by: Kouei Abe <br>
> Signed-off-by: Simon Horman <br>
><br>
> ---<br>
><br>
> v2<br>
> * Add some details to changelog entry<br>
> * Alternate implementation suggested by Catalin Marinas<br>
>   - Add the dsb directly to v7_coherent_user_range() rather<br>
>     than the exception handler<br>
> ---<br>
> arch/arm/Kconfig       |   10 ++++++++++<br>
> arch/arm/mm/cache-v7.S |    3 +++<br>
> 2 files changed, 13 insertions(+)<br>
><br>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig<br>
> index 2f88d8d..48c19d4 100644<br>
> --- a/arch/arm/Kconfig<br>
> +++ b/arch/arm/Kconfig<br>
> @@ -1413,6 +1413,16 @@ config PL310_ERRATA_769419<br>
>    on systems with an outer cache, the store buffer is drained<br>
>    explicitly.<br>
><br>
> +config ARM_ERRATA_775420<br>
> +       bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"<br>
> +       depends on CPU_V7<br>
> +       help<br>
> + This option enables the workaround for the 775420 Cortex-A9 (r2p2,<br>
> + r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance<br>
> + operation aborts with MMU exception, it might cause the processor<br>
> + to deadlock. This workaround puts DSB before executing ISB if<br>
> + an abort may occur on cache maintenance.<br>
> +<br>
> endmenu<br>
><br>
> source "arch/arm/common/Kconfig"<br>
> diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S<br>
> index 39e3fb3..3b17227 100644<br>
> --- a/arch/arm/mm/cache-v7.S<br>
> +++ b/arch/arm/mm/cache-v7.S<br>
> @@ -211,6 +211,9 @@ ENTRY(v7_coherent_user_range)<br>
>   * isn't mapped, fail with -EFAULT.<br>
>   */<br>
> 9001:<br>
> +#ifdef CONFIG_ARM_ERRATA_775420<br>
> + dsb<br>
> +#endif<br>
>   mov r0, #-EFAULT<br>
>   mov pc, lr<br>
>   UNWIND(.fnend )<br>
> --<br>
> 1.7.10.4<br>
><br>
>  </p>